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.17.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7f4271af86569bdbf131dd5c7c121c45d0ed194f3c88b88326e48a3b6a2db12 |
|
MD5 | fa5c2bbf8bf0be66f39c752f5075a65d |
|
BLAKE2b-256 | 40b664fcfa02e69a08e55d66791bf8badea40abac99383f142096e7cab9f687f |
Hashes for watchfiles-0.17.0-pp39-pypy39_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a3d6c699f3ce238dfa90bcef501f331a69b0d9b076f14459ed8eab26ba2f4cf |
|
MD5 | cbddeb5d175f344978a5740954cedca5 |
|
BLAKE2b-256 | f17e97d01fcad72b9234329b090e8739ce04a0634823ce7d45d4a6212cab04df |
Hashes for watchfiles-0.17.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a53cb6c06e5c1f216c792fbb432ce315239d432cb8b68d508547100939ec0399 |
|
MD5 | 017ba7820aff5fc4eb90f3cc589ef5e2 |
|
BLAKE2b-256 | 66c52123a50b6e2f40a7767c1697f03a61d8bb7663c61b7d2cb3d4fb1374fdae |
Hashes for watchfiles-0.17.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad2bdcae4c0f07ca6c090f5a2c30188cc6edba011b45e7c96eb1896648092367 |
|
MD5 | c3b311627a65ebfc47151b3157571169 |
|
BLAKE2b-256 | ee4852e6b276638a868682576ba1dd1a3826839e4792c523e9a3f50364bf2f26 |
Hashes for watchfiles-0.17.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afd35a1bd3b9e68efe384ae7538481ae725597feb66f56f4bd23ecdbda726da0 |
|
MD5 | ea82c63b8a5a751a4a57822772021c2b |
|
BLAKE2b-256 | e1e702af77ed1c6fbe4c52b9e27c8ef10f2690fc4aeaa65c5a318f28102003d4 |
Hashes for watchfiles-0.17.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adcf15ecc2182ea9d2358c1a8c2b53203c3909484918776929b7bbe205522c0e |
|
MD5 | 257ae0ffba8db49e30a825eb12176115 |
|
BLAKE2b-256 | 3f940faba6a21ac16813c5eef1250d17c0c64a56606231bfa1b7b149c876c10f |
Hashes for watchfiles-0.17.0-cp37-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58dc3140dcf02a8aa76464a77a093016f10e89306fec21a4814922a64f3e8b9f |
|
MD5 | fdd7f9ba90a654edfd65471710ab4082 |
|
BLAKE2b-256 | 278569d23f7fd0b93857a3abf1a4537136476c25dbfd88fc3b63bcf702ff48aa |
Hashes for watchfiles-0.17.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53a2faeb121bc51bb6b960984f46901227e2e2475acc5a8d4c905a600436752d |
|
MD5 | 975b791886ef5413af7b0ef4df6d6dfd |
|
BLAKE2b-256 | d6fb365af553845f0fcad9c0b2e587baf73825bd47314c7e849c8df3362d8ed4 |
Hashes for watchfiles-0.17.0-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5c334cd3bc88aa4a8a1e08ec9f702b63c947211275defdc2dd79dc037fcb500 |
|
MD5 | 37e586372c1f7d4a5510ea57d2085e64 |
|
BLAKE2b-256 | 4cca626d0828ce211b08255fa87abea4fbb9d0c51988ba3bd32ddf4dd2eb0b19 |
Hashes for watchfiles-0.17.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffff3418dc753a2aed2d00200a4daeaac295c40458f8012836a65555f288be8b |
|
MD5 | 17464e86e158346ef2a652ed0ad17434 |
|
BLAKE2b-256 | 393bdfb74ca88b5e8f149bfb6adc1159e1e165e7a9cdd1454beec04b73db74ee |
Hashes for watchfiles-0.17.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4056398d8f6d4972fe0918707b59d4cb84470c91d3c37f0e11e5a66c2a598760 |
|
MD5 | 6fe667a5932b6a483ed5d4a0aa7d14e7 |
|
BLAKE2b-256 | 770b9bf88af4daae12b8ea9dfbc5cae83843a6fc7673f10ea568d8f4288a2abb |
Hashes for watchfiles-0.17.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 204950f1d6083539af5c8b7d4f5f8039c3ce36fa692da12d9743448f3199cb15 |
|
MD5 | 31f5612c081e5cea0b32e89aff71be8f |
|
BLAKE2b-256 | 71717d0a44871d316f6143d91bf8d773050b86ae19aeea629bf301a6c8c8c945 |
Hashes for watchfiles-0.17.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dd1e3181ad5d83ca35e9147c72e24f39437fcdf570c9cdc532016399fb62957 |
|
MD5 | 3afddbe437d0fa2d33c1bf404a1dcb98 |
|
BLAKE2b-256 | 4cef08933cdfdfa7e0e206cf5b14dee5db6b61a52f8cef5ecb9e1e203e33eaf8 |
Hashes for watchfiles-0.17.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92675f379a9d5adbc6a52179f3e39aa56944c6eecb80384608fff2ed2619103a |
|
MD5 | 0b1eb29302c1364ea2adfe00ae992ce5 |
|
BLAKE2b-256 | 6ae3b17d27724a2deea610ae08fd71167192f4c8e943e6d8e873f5418c5a2fd4 |
Hashes for watchfiles-0.17.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00e5f307a58752ec1478eeb738863544bde21cc7a2728bd1c216060406bde9c1 |
|
MD5 | a2a3cb93d0dbe4c6b8531ab9a677b8a5 |
|
BLAKE2b-256 | f955d3027b9c636799a02ec65b6ac3b81607fff4c7f0603fda58258dd06ffa6b |
Hashes for watchfiles-0.17.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 539bcdb55a487126776c9d8c011094214d1df3f9a2321a6c0b1583197309405a |
|
MD5 | 9d12b135d1dbc91af0737eab9c3aab74 |
|
BLAKE2b-256 | ee34a250d5dc73c7eaaaf0ec720359f3f83898411e0434c03273c8705fc22818 |
Hashes for watchfiles-0.17.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7e1ffbd03cbcb46d1b7833e10e7d6b678ab083b4e4b80db06cfff5baca3c93f |
|
MD5 | 06273c05d1970eb04ee54778e52fc3fe |
|
BLAKE2b-256 | 868327325bf6e86ddde518c6a51ca8b31035757ae33e6246dc4682999e902190 |