Simple, modern and high performance file watching and code reload in python.
Project description
watchfiles
Simple, modern and high performance file watching and code reload in python.
Documentation: watchfiles.helpmanual.io
Source Code: github.com/samuelcolvin/watchfiles
Underlying file system notifications are handled by the Notify rust library.
This package was previously named "watchgod", see the migration guide for more information.
Installation
watchfiles requires Python 3.7 - 3.10.
pip install watchfiles
Binaries are available for:
- Linux:
x86_64
,aarch64
,i686
,armv7l
,musl-x86_64
&musl-aarch64
- MacOS:
x86_64
&arm64
(except python 3.7) - Windows:
amd64
&win32
Otherwise, you can install from source which requires Rust stable to be installed.
Usage
Here are some examples of what watchfiles can do:
watch
Usage
from watchfiles import watch
for changes in watch('./path/to/dir'):
print(changes)
See watch
docs for more details.
awatch
Usage
import asyncio
from watchfiles import awatch
async def main():
async for changes in awatch('/path/to/dir'):
print(changes)
asyncio.run(main())
See awatch
docs for more details.
run_process
Usage
from watchfiles import run_process
def foobar(a, b, c):
...
if __name__ == '__main__':
run_process('./path/to/dir', target=foobar, args=(1, 2, 3))
See run_process
docs for more details.
arun_process
Usage
import asyncio
from watchfiles import arun_process
def foobar(a, b, c):
...
async def main():
await arun_process('./path/to/dir', target=foobar, args=(1, 2, 3))
if __name__ == '__main__':
asyncio.run(main())
See arun_process
docs for more details.
CLI
watchfiles also comes with a CLI for running and reloading code. To run some command
when files in src
change:
watchfiles "some command" src
For more information, see the CLI docs.
Or run
watchfiles --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for watchfiles-0.19.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20b44221764955b1e703f012c74015306fb7e79a00c15370785f309b1ed9aa8d |
|
MD5 | 6c69a715ca6b48d7a8cb4d0ef0515418 |
|
BLAKE2b-256 | b2dabe8664576654aa13312d5b9e854b9c6b7f759125119e5b69e6cdc74deffd |
Hashes for watchfiles-0.19.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b538014a87f94d92f98f34d3e6d2635478e6be6423a9ea53e4dd96210065e193 |
|
MD5 | 2130a5beb44ff99d013a20817f5f18e1 |
|
BLAKE2b-256 | 8a1c6869ad3639b23b3a88ba5a61aacffaf425666e416cd4e0d8b6b47e666a68 |
Hashes for watchfiles-0.19.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5471582658ea56fca122c0f0d0116a36807c63fefd6fdc92c71ca9a4491b6b48 |
|
MD5 | a2b6b6811b054250fe603dc8f9710cbf |
|
BLAKE2b-256 | b06aa89df14975f21b41d199f745d016dd6cebce232cb7634d3cd441ca67a1eb |
Hashes for watchfiles-0.19.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5569fc7f967429d4bc87e355cdfdcee6aabe4b620801e2cf5805ea245c06097c |
|
MD5 | 999131b36ece445165679eaa2b930229 |
|
BLAKE2b-256 | 9dd1708fc7475e33990792262f23d054692da98b4b8c847772ca12d868d55ac5 |
Hashes for watchfiles-0.19.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68dce92b29575dda0f8d30c11742a8e2b9b8ec768ae414b54f7453f27bdf9545 |
|
MD5 | 4730ebc1a845056a18701a6663cf2491 |
|
BLAKE2b-256 | 9b51104178107563657a7fe5c5d3a0426fa5f61f837698bc349bc93761ce07a5 |
Hashes for watchfiles-0.19.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9afd0d69429172c796164fd7fe8e821ade9be983f51c659a38da3faaaaac44dc |
|
MD5 | c539a2d840a3186c0d07b94e4bddb043 |
|
BLAKE2b-256 | 500e026461f88bf5dafd9bfee6fcf7fe2deddece9d3e0c86d4b7986b0e7c5df3 |
Hashes for watchfiles-0.19.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f3920b1285a7d3ce898e303d84791b7bf40d57b7695ad549dc04e6a44c9f120 |
|
MD5 | 88e96167ca7c3d9f44cae818f4573d3a |
|
BLAKE2b-256 | 642288e5143e4397bf30cde669b78fb2a2fcdbaaa0e8b5fea5ae402d2e5a7bc2 |
Hashes for watchfiles-0.19.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cae3dde0b4b2078f31527acff6f486e23abed307ba4d3932466ba7cdd5ecec79 |
|
MD5 | 41d3a02c92baf2f32549327d3e1ee6b9 |
|
BLAKE2b-256 | 1e6886742189038396f0b8df17556690c5fdb350e74c2b947782a165c6f69acb |
Hashes for watchfiles-0.19.0-cp37-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0089c6dc24d436b373c3c57657bf4f9a453b13767150d17284fc6162b2791911 |
|
MD5 | 7bc08a7d54a8d388ec4b65977eea80c2 |
|
BLAKE2b-256 | 298a6293b04bcb667e43808921cc8794f6231aa4ea819d0cdb659b3e3cf862f1 |
Hashes for watchfiles-0.19.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 945be0baa3e2440151eb3718fd8846751e8b51d8de7b884c90b17d271d34cae8 |
|
MD5 | b20832de04c46e4efb8a890d63e853e1 |
|
BLAKE2b-256 | fe1d3948e864ae4f4c87cd32d980aff9b7b8767f74e0d8ea0b70a07a86226087 |
Hashes for watchfiles-0.19.0-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176a9a7641ec2c97b24455135d58012a5be5c6217fc4d5fef0b2b9f75dbf5154 |
|
MD5 | 983e078e086ed5bfa1ab5c3435bd2191 |
|
BLAKE2b-256 | ad5dbc89d194bac1baafa4e98bade4d778d5b2918e4b9cc45284ec78c90b135c |
Hashes for watchfiles-0.19.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d7d267d27aceeeaa3de0dd161a0d64f0a282264d592e335fff7958cc0cbae7c |
|
MD5 | 7fffbbe12cadfc9db4e8e1fd18d3160c |
|
BLAKE2b-256 | 661c5b14d4be9f02a96c2f06b92d9bc3335ced1f4e1c7ea6e522fa4c9a517f28 |
Hashes for watchfiles-0.19.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79c533ff593db861ae23436541f481ec896ee3da4e5db8962429b441bbaae16e |
|
MD5 | c86830cc4c4f26c09522fb6ade58aff3 |
|
BLAKE2b-256 | 476ade51bae85bcbf17dc9389589162c8996ed72bf6e97b81c8c6d60666e4768 |
Hashes for watchfiles-0.19.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb5d45c4143c1dd60f98a16187fd123eda7248f84ef22244818c18d531a249d1 |
|
MD5 | 04e4a0beaf1f76b1c172353c8cf03f10 |
|
BLAKE2b-256 | f240cd125248cd1bb1fd449d2439d9a1b599c9f6dc255645838ce0be96b28337 |
Hashes for watchfiles-0.19.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c75eff897786ee262c9f17a48886f4e98e6cfd335e011c591c305e5d083c056 |
|
MD5 | 576b8a214bce5542463cb8d4cf2c32f2 |
|
BLAKE2b-256 | aa3bc648597eb3611c4b72eda09aa9069773f6b4459bd7142cf200dcd34acfcf |
Hashes for watchfiles-0.19.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0376deac92377817e4fb8f347bf559b7d44ff556d9bc6f6208dd3f79f104aaf |
|
MD5 | f01951deaae2b2f1f3d62cbe8be96f3b |
|
BLAKE2b-256 | 796508d06f63c2d983c733e225b9cd2ba9f36b7ccb1095854b66d0010ca36013 |
Hashes for watchfiles-0.19.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09ea3397aecbc81c19ed7f025e051a7387feefdb789cf768ff994c1228182fda |
|
MD5 | fc973c7c3b5ec54df44786c53183cbd5 |
|
BLAKE2b-256 | b1955fa75076399195838c618e06418dbc4996613e3e57fbecd0c1d86764afbf |
Hashes for watchfiles-0.19.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac19dc9cbc34052394dbe81e149411a62e71999c0a19e1e09ce537867f95ae0 |
|
MD5 | 206a0d8a03ef7b9cb677a5cc601f5ce3 |
|
BLAKE2b-256 | 92e5a77ee68cbeedf342f317214a5b48f4c191d021b57836ef3b2c39bcbb516c |
Hashes for watchfiles-0.19.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b28f6ad871b82df9542ff958d0c86bb0d8310bb09eb8e87d97318a3b5273af |
|
MD5 | 3e1144642feba90c586ff2c676f4d524 |
|
BLAKE2b-256 | 0982a9e1b9741cefa592dcd85f8ebdf739a24c6572b5ab58ce65589f340b3cff |
Hashes for watchfiles-0.19.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6577b8c6c8701ba8642ea9335a129836347894b666dd1ec2226830e263909d3 |
|
MD5 | b16c3df60c63f7d5f17ce4903d7026e7 |
|
BLAKE2b-256 | 8ee185f1454e0c6335e32d1bd900237d34f76db2b261a515bc47188d8e3eea65 |
Hashes for watchfiles-0.19.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91633e64712df3051ca454ca7d1b976baf842d7a3640b87622b323c55f3345e7 |
|
MD5 | cff693a50f05990cda429ebeb7530831 |
|
BLAKE2b-256 | 2f7f0fb6699188e4a553e10e94a479fe4280a17d29f3a8b8b8f11d6291a82006 |