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.20.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87d9e1f75c4f86c93d73b5bd1ebe667558357548f11b4f8af4e0e272f79413ce |
|
MD5 | f519d2a28747a58c9e6ec82d3d5bb095 |
|
BLAKE2b-256 | b770179332ce3ce5c8124686acbe99ea26d2db0775be21326d6006159c9a53fd |
Hashes for watchfiles-0.20.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e43af4464daa08723c04b43cf978ab86cc55c684c16172622bdac64b34e36af0 |
|
MD5 | 9dc02e27139fc44c019226fd5c83f473 |
|
BLAKE2b-256 | 8856970242822425ab5669b578dc86eb110b386f81b3d46591c8f7da3e68aa69 |
Hashes for watchfiles-0.20.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b5c8d3be7b502f8c43a33c63166ada8828dbb0c6d49c8f9ce990a96de2f5a49 |
|
MD5 | 37bd9b48f7d8411f570cf50441b00b8b |
|
BLAKE2b-256 | 92a18efa83e0631cef8d41a73144f7d4b7a2c4d74f2a7e518a629a508d22c0de |
Hashes for watchfiles-0.20.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13f995d5152a8ba4ed7c2bbbaeee4e11a5944defc7cacd0ccb4dcbdcfd78029a |
|
MD5 | 1123725ed1ce4f6a4f7d009bb880d0df |
|
BLAKE2b-256 | bf1eaf6c27b94d56b4aa6a291b091b1f12003f1fbc954fab3b3940038fc5e4ea |
Hashes for watchfiles-0.20.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d1de8218874925bce7bb2ae9657efc504411528930d7a83f98b1749864f2ef |
|
MD5 | e6ab954fb7c1ed8b47c5089b86c23163 |
|
BLAKE2b-256 | c5fe09ea0587d4e4f40178ec56d0733921086d767ae858c71a3c88a83a229237 |
Hashes for watchfiles-0.20.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 608cd94a8767f49521901aff9ae0c92cc8f5a24d528db7d6b0295290f9d41193 |
|
MD5 | 5782cb57648a67cd1141a5e42c1121f9 |
|
BLAKE2b-256 | 962b42964b544f4c0302c369862f04ea405e39b17ee86c2cf9832426747063e5 |
Hashes for watchfiles-0.20.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 835df2da7a5df5464c4a23b2d963e1a9d35afa422c83bf4ff4380b3114603644 |
|
MD5 | 1ae3354b8b09fffed55750275aeb432c |
|
BLAKE2b-256 | 8c2d95f31c69aac82084559dd4097b55afdcd2fa0acaf662d3276f01a368b380 |
Hashes for watchfiles-0.20.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d97db179f7566dcf145c5179ddb2ae2a4450e3a634eb864b09ea04e68c252e8e |
|
MD5 | 73c219e751a0ba7e6deb8431777584f0 |
|
BLAKE2b-256 | a0bc4dad023b50456f5f70a5b409c1f888ef8dfe44a854f952764309a28faa57 |
Hashes for watchfiles-0.20.0-cp37-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b17d4176c49d207865630da5b59a91779468dd3e08692fe943064da260de2c7c |
|
MD5 | f5ed7d87230072567fc3a9b398f29486 |
|
BLAKE2b-256 | 3f8245dddf4f5bf8b73ba27382cebb2bb3c0ee922c7ef77d936b86276aa39dca |
Hashes for watchfiles-0.20.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eccc8942bcdc7d638a01435d915b913255bbd66f018f1af051cd8afddb339ea3 |
|
MD5 | f9d09108ebdb1ff491b693cca5a5b9dc |
|
BLAKE2b-256 | 8779098b1b1fcb6de16149d23283a2ab5dadce6a06b864e7a182d231f57a1f9e |
Hashes for watchfiles-0.20.0-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a03d1e6feb7966b417f43c3e3783188167fd69c2063e86bad31e62c4ea794cc5 |
|
MD5 | 2bc4f27a1ae2176a7b4c6e70644aafcf |
|
BLAKE2b-256 | 91d40c0fdcc4293ad1b73db54896fa0de4b37439ae4f25971b5eb1708dd04f9a |
Hashes for watchfiles-0.20.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d4e66a857621584869cfbad87039e65dadd7119f0d9bb9dbc957e089e32c164 |
|
MD5 | a45b69e6e98028d34d633693e56b702f |
|
BLAKE2b-256 | 11c075f5a71ac24118ab11bd898e0114cedc72b25924ff2d960d473bddb4ec6e |
Hashes for watchfiles-0.20.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08dc702529bb06a2b23859110c214db245455532da5eaea602921687cfcd23db |
|
MD5 | 4567ec58fccc733abb80127c84c7a598 |
|
BLAKE2b-256 | 595e6b64e3bf9fd4422250f3c716d992dd76dbe55e6fa1e7ebaf2bf88f389707 |
Hashes for watchfiles-0.20.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5392dd327a05f538c56edb1c6ebba6af91afc81b40822452342f6da54907bbdf |
|
MD5 | 9b02dba2152f739f47bb863841277291 |
|
BLAKE2b-256 | e146c9d5ee4871b187d291d62e61c41f9a4d67d4866a89704b0ad16b6949e9bd |
Hashes for watchfiles-0.20.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99f4c65fd2fce61a571b2a6fcf747d6868db0bef8a934e8ca235cc8533944d95 |
|
MD5 | 71360970c078903e1af2299c9f4277e6 |
|
BLAKE2b-256 | 6b813f922f3ede53ca9c0b4095f63688ffeea19a49592d0ac62db1eb9632b1e3 |
Hashes for watchfiles-0.20.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d82dbc1832da83e441d112069833eedd4cf583d983fb8dd666fbefbea9d99c0 |
|
MD5 | 1717a3b8e7b77dad66a9342809196e87 |
|
BLAKE2b-256 | 13ead11971958ae703cfe443b21f672169cb8bc12dbec5781b910633fa2186ec |
Hashes for watchfiles-0.20.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 007dcc4a401093010b389c044e81172c8a2520dba257c88f8828b3d460c6bb38 |
|
MD5 | d591172d5107e221987151e8d6442422 |
|
BLAKE2b-256 | 05a02fb2c36730995a6b3f060187195dc08ad9ceee67426bdca8a4296024071c |
Hashes for watchfiles-0.20.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a0351d20d03c6f7ad6b2e8a226a5efafb924c7755ee1e34f04c77c3682417fa |
|
MD5 | 878410bdef832d5b8c9cb4f7c36b4a2f |
|
BLAKE2b-256 | 21e5b080cec4e841b1cf338ccbd958cf3232ad1691a590653b2d124b5c79cf6b |
Hashes for watchfiles-0.20.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 570848706440373b4cd8017f3e850ae17f76dbdf1e9045fc79023b11e1afe490 |
|
MD5 | c6d348aa35e8c78b30406f03240a399e |
|
BLAKE2b-256 | 25aeb7bddad421af5e33079a2ce639aa58837b715a2da98df16e25ecd310af52 |
Hashes for watchfiles-0.20.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0002d81c89a662b595645fb684a371b98ff90a9c7d8f8630c82f0fde8310458 |
|
MD5 | df5695b6e7447d3ee30dc9fb5d21a47f |
|
BLAKE2b-256 | 9f1a85c914e4db62a3f8197daa98a271ea380a5d200a8d3058bd9f417752bc26 |
Hashes for watchfiles-0.20.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3796312bd3587e14926013612b23066912cf45a14af71cf2b20db1c12dadf4e9 |
|
MD5 | b56662071bbe55c8c796fe6dca2c3b26 |
|
BLAKE2b-256 | 4ddb899832e11fef2d468bf8b3c1c13289b1db4cb7c3410bb2a9612a52fc8b22 |