Skip to main content

Simple, modern and high performance file watching and code reload in python.

Project description

watchfiles

CI Coverage pypi CondaForge license

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

watchfiles-0.18.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distributions

watchfiles-0.18.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

watchfiles-0.18.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

watchfiles-0.18.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl (374.1 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.18.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

watchfiles-0.18.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

watchfiles-0.18.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl (374.4 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.18.0-cp37-abi3-win_arm64.whl (253.1 kB view details)

Uploaded CPython 3.7+ Windows ARM64

watchfiles-0.18.0-cp37-abi3-win_amd64.whl (261.0 kB view details)

Uploaded CPython 3.7+ Windows x86-64

watchfiles-0.18.0-cp37-abi3-win32.whl (250.9 kB view details)

Uploaded CPython 3.7+ Windows x86

watchfiles-0.18.0-cp37-abi3-musllinux_1_1_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.1+ x86-64

watchfiles-0.18.0-cp37-abi3-musllinux_1_1_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.1+ ARM64

watchfiles-0.18.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

watchfiles-0.18.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

watchfiles-0.18.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

watchfiles-0.18.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (1.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

watchfiles-0.18.0-cp37-abi3-macosx_11_0_arm64.whl (363.6 kB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

watchfiles-0.18.0-cp37-abi3-macosx_10_7_x86_64.whl (373.8 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

Details for the file watchfiles-0.18.0.tar.gz.

File metadata

  • Download URL: watchfiles-0.18.0.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for watchfiles-0.18.0.tar.gz
Algorithm Hash digest
SHA256 bbe10d134eef1666451382015e48f092c941a6d4562a98ffa1a288f79a897c46
MD5 b6d454fe634de4ed2158749a51454191
BLAKE2b-256 867793890b16c82d08137b95cef4629914e41df78480108b04ab447e9adb13c5

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for watchfiles-0.18.0-cp37-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 184799818c4fa7dbc6a1e4ca20bcbc6b85e4e0db07ce4554ea2f29b75ccd0cdc
MD5 6dff883f2b2418ff4c63cbbb132d17b2
BLAKE2b-256 d1b6d547ed939307a1a895f8e621184dd7f52b968003765d2c48c36029a86f07

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for watchfiles-0.18.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 be87c9b1fe2b02105a9ac6d9df7500a110652bbd97cf46b13964eeaef9a6c89c
MD5 bcb4214ac222845dea97a963593ebc31
BLAKE2b-256 1460355bfb0db132c66d80fa56b1044b46cf2795b15099951fd430ee2b03a561

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-win32.whl.

File metadata

  • Download URL: watchfiles-0.18.0-cp37-abi3-win32.whl
  • Upload date:
  • Size: 250.9 kB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for watchfiles-0.18.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 8eddc2d19bf6f49aee224072ec0f4f3258125a49f11b5dcff1448e68718a745e
MD5 dd3d9449da9445e82d0ef29bf62ca942
BLAKE2b-256 7d3b962884d642615b42358568023bf87cfd00533de63b352354db5aaeae57d2

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for watchfiles-0.18.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 cfdbfc4b6797c28dd1a8524581fed00ca333971b4111af8cd42fb7a92dcdc227
MD5 0d6f2bb49d61fd99c4acc75f64a9e585
BLAKE2b-256 eb40464afc392f87199abb7d87387f1c414b4bde09a3f5ee950452cfe3f1d8b1

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for watchfiles-0.18.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 fd4215badad1e3d1ad5fb79f21432dd5157e2e7b0765d27a19dc2a28580c6979
MD5 3f9aa7dc72c40af15321641a36c2c6f6
BLAKE2b-256 efbbbfcd1165f0dc06d7fdc09a042640b2e2c9a0119493d5ce42ec4bbc52cd32

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for watchfiles-0.18.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5d799614d4c56d29c5ba56f4f619f967210dc10a0d6965b62d326b9e2f72c9e
MD5 a284cd2c907bc7a4fbce856923ee9768
BLAKE2b-256 04589d7bd8868fcc598f46f0f5b11df6428dc5aa942a0ebcef535baeac9f5df6

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.18.0-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for watchfiles-0.18.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 76a4c4a8e25a2c9a4f7fa3d373bbaf5558c17b97b4cf8411d33de368fe6b68a9
MD5 cf08a198b32b4fa7601e4d41b398d3d9
BLAKE2b-256 fe1d73d00065fc7e2abffc970ed41ed749c74a33d598d40a139ea8fb0f23cd6c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page