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.18.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e611a90482ac14ef3ec234c1604ed921d1b0c68970eba82f1cf0d59a3e4eb76 |
|
MD5 | f6ce62a321c21e1269b70cc39174d0eb |
|
BLAKE2b-256 | 7a7e679015b44ed2beae007ef469a97d17ec98600b20e280c01e010a188953dc |
Hashes for watchfiles-0.18.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d3a12e4de5446fb6e286b720d0cb3a080811caf0ef43e556c2db5fe10ef0342 |
|
MD5 | c0d9755955b29b058ed422dc96130ff5 |
|
BLAKE2b-256 | 0cfc7fe10dba6aefd4ea40bd9ff4c619d20fab11995213509397bf1c0485c0be |
Hashes for watchfiles-0.18.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bbc8bfa0f3871b1867af42837a5635a9c1cbb2b68d039754b4750642c34aaee |
|
MD5 | d269dced0cf53b2cc1853a1620a8f3f5 |
|
BLAKE2b-256 | f1d9489ce8d8dc1484111c2a87f339e0ff13593834316b33eba43e9f2646eec4 |
Hashes for watchfiles-0.18.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27d64a6ed5e0aebef97c70fa3899a6958d4f7f049effc659e7dc3e81f3170a7b |
|
MD5 | d4851fb9850d19751e26431eb8d62e8d |
|
BLAKE2b-256 | 5de6dbdae40e1c5146ffa8320db103e772b7ecdecd93d4971d5de1c815a400ac |
Hashes for watchfiles-0.18.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b1e7c29b92dfc8fc32f15949019232b493767d236c2bff31848df13fdb9e8a |
|
MD5 | 7c63a8d4486b50877c127a4bb1f88b91 |
|
BLAKE2b-256 | 2e35098e6367b435bc98f248887dedd85c003c4849ab66a35b7ec12a3570bd9c |
Hashes for watchfiles-0.18.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f39fcdac5d5b9815a0c2ab9005d39854296b11fa15386a9a69c09cbbc5dde2c |
|
MD5 | 0d3d108c758b95b018b376678332bd89 |
|
BLAKE2b-256 | f9f2ab59b33a88820440f45161bde1a1d4c45cea1a4c4f8157ec94aab166c9a6 |
Hashes for watchfiles-0.18.0-cp37-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 184799818c4fa7dbc6a1e4ca20bcbc6b85e4e0db07ce4554ea2f29b75ccd0cdc |
|
MD5 | 6dff883f2b2418ff4c63cbbb132d17b2 |
|
BLAKE2b-256 | d1b6d547ed939307a1a895f8e621184dd7f52b968003765d2c48c36029a86f07 |
Hashes for watchfiles-0.18.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be87c9b1fe2b02105a9ac6d9df7500a110652bbd97cf46b13964eeaef9a6c89c |
|
MD5 | bcb4214ac222845dea97a963593ebc31 |
|
BLAKE2b-256 | 1460355bfb0db132c66d80fa56b1044b46cf2795b15099951fd430ee2b03a561 |
Hashes for watchfiles-0.18.0-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eddc2d19bf6f49aee224072ec0f4f3258125a49f11b5dcff1448e68718a745e |
|
MD5 | dd3d9449da9445e82d0ef29bf62ca942 |
|
BLAKE2b-256 | 7d3b962884d642615b42358568023bf87cfd00533de63b352354db5aaeae57d2 |
Hashes for watchfiles-0.18.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfdbfc4b6797c28dd1a8524581fed00ca333971b4111af8cd42fb7a92dcdc227 |
|
MD5 | 0d6f2bb49d61fd99c4acc75f64a9e585 |
|
BLAKE2b-256 | eb40464afc392f87199abb7d87387f1c414b4bde09a3f5ee950452cfe3f1d8b1 |
Hashes for watchfiles-0.18.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd4215badad1e3d1ad5fb79f21432dd5157e2e7b0765d27a19dc2a28580c6979 |
|
MD5 | 3f9aa7dc72c40af15321641a36c2c6f6 |
|
BLAKE2b-256 | efbbbfcd1165f0dc06d7fdc09a042640b2e2c9a0119493d5ce42ec4bbc52cd32 |
Hashes for watchfiles-0.18.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ba6d8c2f957cae3e888bc250bc60ed09fe869b3f55f09d020ed3fecbefb6a4c |
|
MD5 | 2a080cb85291fde73cd78f2a967dfc5a |
|
BLAKE2b-256 | faa4cdf121a2e2d7f39388bda35879e533e78cfa9a97fa237b44b445d3a7e88b |
Hashes for watchfiles-0.18.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 320bcde0adaa972403ed3b70f784409437325a1a4df2de54ba0672203d8847e5 |
|
MD5 | 1ed63636d52a26d110f0e3296a660626 |
|
BLAKE2b-256 | efb7663c5f3a4ae99e7d7b3cd787f756ce618013799b6f8e3b008c5a0bab602c |
Hashes for watchfiles-0.18.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1686bc4ac40ffde7256b6543b0f9a2cc8b531ae45243786f1d3f1dda2fe39e24 |
|
MD5 | 53e758979f7621891c9d8b67256d3191 |
|
BLAKE2b-256 | 3a78575c946a72305b5ba4862ebb855ee951608de61a3dd85c898a188704432a |
Hashes for watchfiles-0.18.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39b932b044fef6c43e813e0bef908e0edf185bf7b5d8d53246651cb7ac9efe79 |
|
MD5 | c69c44d9e6593bccb2fcf391e4fe0e3f |
|
BLAKE2b-256 | 4cd8cd598f6938a3380d11e24964f3acd0dbb74cbfd6538f8cdfc478dfa3e371 |
Hashes for watchfiles-0.18.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5d799614d4c56d29c5ba56f4f619f967210dc10a0d6965b62d326b9e2f72c9e |
|
MD5 | a284cd2c907bc7a4fbce856923ee9768 |
|
BLAKE2b-256 | 04589d7bd8868fcc598f46f0f5b11df6428dc5aa942a0ebcef535baeac9f5df6 |
Hashes for watchfiles-0.18.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76a4c4a8e25a2c9a4f7fa3d373bbaf5558c17b97b4cf8411d33de368fe6b68a9 |
|
MD5 | cf08a198b32b4fa7601e4d41b398d3d9 |
|
BLAKE2b-256 | fe1d73d00065fc7e2abffc970ed41ed749c74a33d598d40a139ea8fb0f23cd6c |