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 Distributions
Built Distributions
Hashes for watchfiles-0.16.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcd085980389bc64fe509188a9caffa4fe13b2616e2e3e674cde58f916b2a8ee |
|
MD5 | 871a81713f9bc8faff82775d5fec57e5 |
|
BLAKE2b-256 | f789608d47f7ad6ae9e944bb781f8d0d3bded7a63d9d983d49ca24280a326651 |
Hashes for watchfiles-0.16.0-pp39-pypy39_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f712dbe9d8c0365bf46ffe0dd9c6a62cc0acf05ba951f1a53de2b4d5bb63299 |
|
MD5 | b0156edde1b4ca5f4c82c1363f965056 |
|
BLAKE2b-256 | c90ac5ed9668f7766b77ed3ecab4f33686169dc84fbc3c425d08c68d4ec4dd7d |
Hashes for watchfiles-0.16.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09490d258be8fdd7f5141a39b468dede0b4aa4a52f2b2dbfb0f3835ae7c23eca |
|
MD5 | a3e1d4f5e37ef157b3c0714eb11d081d |
|
BLAKE2b-256 | decc09f0b7fcf5cde18aae8eb3119fd9351b2e6af734ba3a555ab3b5566b5ac8 |
Hashes for watchfiles-0.16.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d3f0397c9128971398a5cbb0fb45852ab2fa4472ac9724c031071e1e39970c0 |
|
MD5 | 6174a2de5acbc5064688dc5ed490c7da |
|
BLAKE2b-256 | f38f5b9db254d96fe2cf5f942b7b7de5a39fe76e708769981cacec619417e277 |
Hashes for watchfiles-0.16.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e3d4c92091d16bca1d61920575dab5d6dcbceda76dccd5fb91da0b7390b4ee9 |
|
MD5 | 476d86cd76374cf2c57bf1bde8d63d22 |
|
BLAKE2b-256 | 95f1ed4ed209c7ed5b63fc737fddf3f4afc5790bd5c0d037a8a7a0e87da05289 |
Hashes for watchfiles-0.16.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9e3756cd2ba17e5042e8c9399a08e4bdbe1a366156a164e8373bda30ca096d0 |
|
MD5 | 887521cf7cde884f3cb5841703ce6907 |
|
BLAKE2b-256 | 276618cd55c2cdca9ddc4120b122c4202d6252bb92c52e64b3d98df3cc09aeb0 |
Hashes for watchfiles-0.16.0-cp37-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 750e40db5efcf3f5f11602dbc6fdf8e96a0eefdbccd271093efe9fa2e9d02ed2 |
|
MD5 | 7d4c394aac2fb4546f157664b047422e |
|
BLAKE2b-256 | d8e446a6111709dda2148fd5619bed2c77efe520a3c18201167e999591c06691 |
Hashes for watchfiles-0.16.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 059bd9596429f8c13604b2eb30888a5661b3c79099edc506f11b63be7afe3ca4 |
|
MD5 | bdd73dded968ef00184520973be89eb9 |
|
BLAKE2b-256 | 6231b357881a35ea4c93396e3d3300b84ac5cda52d4857af3f881d3160a1189e |
Hashes for watchfiles-0.16.0-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbdb7814ca43f85ab8569206ab2c3bcd51dd5d1ba582914246784414e6ada62e |
|
MD5 | d701362328afdbc3ef0ea20924713804 |
|
BLAKE2b-256 | 139eaf690dcc809558723881af67fcfa99f15e7aade0acdd2b2ee9765c8b4994 |
Hashes for watchfiles-0.16.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c80e3907d21ca3f1689f42632d239fdc40ffc1d5f32f564997480f85e94c474 |
|
MD5 | 423f82988ad4c623be8efe0782fdf451 |
|
BLAKE2b-256 | 17fe15704508a3d5e2a880f8efbba5e06511586fe99b7cc6c75be9dddd33617a |
Hashes for watchfiles-0.16.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43d1d517faffa8955c2da0e6f64268e38442d43b50ca73cb686df25f891e49a1 |
|
MD5 | 77399e00626dde7bb7a8da0c6b4d745e |
|
BLAKE2b-256 | 08836cd2097ae756f57bb2ab0eec3fb460ee935b73a5a966655c2119611df7c2 |
Hashes for watchfiles-0.16.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59498853d3214d1e4d9b1cb3a06b0011a11f24d31708b1734d9cd7f5a30fe1af |
|
MD5 | 013b6e3424435f56ffd71b2779aefab7 |
|
BLAKE2b-256 | 61db99d047f72762d8ed448b5c47a072e815039d9d250c38fc3f2e64eec34589 |
Hashes for watchfiles-0.16.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5fb4f3b5c884d4f22f643b0697edbb04942bcad961a8f9a9bfadb73e7a1e229 |
|
MD5 | ce369aae2ce67646395b6746e04eb96f |
|
BLAKE2b-256 | 705b80b48457541a082f028e7958d16a68c80dda0a1855ecd2a078d2170113ed |
Hashes for watchfiles-0.16.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bb5f0117c8b93f8e1b22ac0be60cfeb00332959a72e6bbe2073fea27ed086e5 |
|
MD5 | e4c04e81f1c8a4b2d7399473182a2ce4 |
|
BLAKE2b-256 | 80ca4ecfa87e56aa50b6c1eb9ded801e8e53f25ed0b7037102d75e6d5e81e5fa |
Hashes for watchfiles-0.16.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5f64674559fac56a6bf2f5e086cb3758740140c80711fe3e016f5443b84ef15 |
|
MD5 | c75ff549c094ae6cfa3155ef23b6ae79 |
|
BLAKE2b-256 | 125ba0fa0ca0e0aa9e475f4079c837e3f4c11c75aca2e9c0bfcae2cf63c83f80 |
Hashes for watchfiles-0.16.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fa786d102e7eabef22b2147af531aa70194aabcb35335be81c07c26382b0050 |
|
MD5 | fa28472b24c6ff77334b3c08be45133c |
|
BLAKE2b-256 | 7187798d529ae81a5cb837ea8c3740c48fe0cb1f2296ce3da17f3e26a9f51c71 |
Hashes for watchfiles-0.16.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d635dcba3aab2909bf568765547696d7465d30e2e9c6f5ab99da877b58d29bb |
|
MD5 | 7e381e2d5c41e7889105475bafa530cd |
|
BLAKE2b-256 | 4cc5586fbca85087dac64ef56791813d760a96bb42b6d3e22c65539ff071f9c9 |