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.16.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a6a1ac96edf5bc3f8e36f4462fc1daad0ec3769ff2adb920571e120e37c91c5 |
|
MD5 | 850fda09a417ad715180ff76213bffe8 |
|
BLAKE2b-256 | b65d20634da4339ea7a57b4425b659b3eff157dd05385af75c41c8c6a1c22d32 |
Hashes for watchfiles-0.16.1-pp39-pypy39_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22af3b915f928ef59d427d7228668f87ac8054ed8200808c73fbcaa4f82d5572 |
|
MD5 | a5c1966b1743881a05ff3bf10e8419f5 |
|
BLAKE2b-256 | 909ce71e90d6711287ed5dc09a41cdc7d23adcc11fcb4db69b396ac540fdbf01 |
Hashes for watchfiles-0.16.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70159e759f52b65a50c498182dece80364bfd721e839c254c328cbc7a1716616 |
|
MD5 | 39c835dacd4191f9d4d2de3eb0b48db3 |
|
BLAKE2b-256 | 3dd356cdd58cd90a9b6ccfd66108f140ff2026f1a6a5664f7af0cbb4e15b563a |
Hashes for watchfiles-0.16.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91d1b2d0cf060e5222a930a3e2f40f6577da1d18c085c32741b98a128dc1e72c |
|
MD5 | 6c62fe046fbaff2fc6e6e9f30658ccbd |
|
BLAKE2b-256 | 4a2f417d54a2d237eb230ad1e3815c5d7583bbc2906f133b3a4ae02316cee59a |
Hashes for watchfiles-0.16.1-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44c6aff58b8a70a26431737e483a54e8e224279b21873388571ed184fe7c91a7 |
|
MD5 | d705bcd2b278c3e73f408ef7fec29ace |
|
BLAKE2b-256 | 03d1a57a3eebdeec2cdb94f8e2d9874abd95b5bb3338edc084ad1d4d7022ba9a |
Hashes for watchfiles-0.16.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5741246ae399a03395aa5ee35480083a4f29d58ffd41dd3395594f8805f8cdbc |
|
MD5 | d473c71db848fd9cd858ac4cec29902b |
|
BLAKE2b-256 | 4d1463513f155fcc8249ffdb2334e9a49047f317e6b512ea5635f5d068fee4cd |
Hashes for watchfiles-0.16.1-cp37-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baa6d0c1c5140e1dcf6ff802dd7b09fcd95b358e50d42fabc83d83f719451c54 |
|
MD5 | 89fe82b9e51e6a1d73219ffcf6afda95 |
|
BLAKE2b-256 | 88d5fa9239cf1c2ca3171b136d99be2338c673114ac32937f716c1683f3e9c01 |
Hashes for watchfiles-0.16.1-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8a1809bf910672aa0b7ed6e6045d4fc2cf1e0718b99bc443ef17faa5697b68a |
|
MD5 | bce0277b64d5f1ab9a7962e3a591386b |
|
BLAKE2b-256 | 1ca5fb8a7f947bc7fa35e035d66444ceecf826edce67e199a9bd75dfb904fcc2 |
Hashes for watchfiles-0.16.1-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f91035a273001390093a09e52274a34695b0d15ee8736183b640bbc3b8a432ab |
|
MD5 | 538b9f5ff1a5a472bd01f686443ced78 |
|
BLAKE2b-256 | 11e7ddbdf912623d971dce1bf73e5c0ef9b072a27388b3ba7527309107e26278 |
Hashes for watchfiles-0.16.1-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd7d2fd9a8f28066edc8db5278f3632eb94d10596af760fa0601631f32b1a41e |
|
MD5 | d5e0c32c4aef998712a3be61d20c6e2c |
|
BLAKE2b-256 | 3997dd1811872484bc9401a00c81310750b70c159ba8af8f51732fe1ba50bd86 |
Hashes for watchfiles-0.16.1-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e939a2693404ac11e055f9d1237db8ad7635e2185a6143bde00116e691ea2983 |
|
MD5 | 20421b56d2f8f09e94f00799f2e53a81 |
|
BLAKE2b-256 | d07222709613fc2c7784853887a8dbb035411ec1da3fe821a27c9060fcc08640 |
Hashes for watchfiles-0.16.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9a7a6dc63684ff5ba11f0be0e64f744112c3c7a0baf4ec8f6794f9a6257d21e |
|
MD5 | c34db0bd8e209ef90b7cb5c89fcf146b |
|
BLAKE2b-256 | 4bb229018ddcedd2508f69ec5e15b6f2572c949a9fc4f0be0c8675b3739f50ac |
Hashes for watchfiles-0.16.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35f3e411822e14a35f2ef656535aad4e6e79670d6b6ef8e53db958e28916b1fe |
|
MD5 | 60996a5c8762beaaea82de6734bba7d8 |
|
BLAKE2b-256 | 00b697cce735fe182b95efd7ef00482d5fed8c9e407a2003f3f62a7781f98605 |
Hashes for watchfiles-0.16.1-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a3debb19912072799d7ca53e99fc5f090f77948f5601392623b2a416b4c86be |
|
MD5 | bc0e448d8cc0f26b4b173e604bd187a2 |
|
BLAKE2b-256 | 2651f8e24be3bf4b387cca8f99aa7979f6ea45aaeea1ff5c7952a5bc9540518a |
Hashes for watchfiles-0.16.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75a4b9cec1b1c337ea77d4428b29861553d6bf8179923b1bc7e825e217460e2c |
|
MD5 | 1acd6fbd34c31af3f7e5a99b87b772f7 |
|
BLAKE2b-256 | d89b7e66a5c7160d8e666492b1e754294c41446481eebed7e0664e431c0849d4 |
Hashes for watchfiles-0.16.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2c7ad91a867dd688b9a12097dd6a4f89397b43fccee871152aa67197cc94398 |
|
MD5 | f305d4b3c2297756fc12587b83750a4f |
|
BLAKE2b-256 | c3756d96184a9f4109b7f78b9354593e079e5b396a4c24cf3457ea8b0f3ad40b |
Hashes for watchfiles-0.16.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e41c8b4bf3e07c18aa51775b36b718830fa727929529a7d6e5b38cf845a06b4 |
|
MD5 | d4b81698d30894b49c77358a2e766c96 |
|
BLAKE2b-256 | 5f4a2b52317fc3d70896b8dc166bf50157333fcf192077a42e1e8616ac224dca |