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.1.tar.gz (35.6 kB view details)

Uploaded Source

Built Distributions

watchfiles-0.18.1-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.1-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.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl (378.3 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.18.1-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.1-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.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl (378.5 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.18.1-cp37-abi3-win_arm64.whl (256.1 kB view details)

Uploaded CPython 3.7+ Windows ARM64

watchfiles-0.18.1-cp37-abi3-win_amd64.whl (264.0 kB view details)

Uploaded CPython 3.7+ Windows x86-64

watchfiles-0.18.1-cp37-abi3-win32.whl (253.5 kB view details)

Uploaded CPython 3.7+ Windows x86

watchfiles-0.18.1-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.1-cp37-abi3-musllinux_1_1_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.1+ ARM64

watchfiles-0.18.1-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.1-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.1-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.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (1.3 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

watchfiles-0.18.1-cp37-abi3-macosx_11_0_arm64.whl (367.2 kB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

watchfiles-0.18.1-cp37-abi3-macosx_10_7_x86_64.whl (377.9 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for watchfiles-0.18.1.tar.gz
Algorithm Hash digest
SHA256 4ec0134a5e31797eb3c6c624dbe9354f2a8ee9c720e0b46fc5b7bab472b7c6d4
MD5 d3f7bde2c255723425ba8c8923eb6bda
BLAKE2b-256 5e6a2760278f309655cc7305392b0bb664738104202bf5d50396eb138258c5ca

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a868ce2c7565137f852bd4c863a164dc81306cae7378dbdbe4e2aca51ddb8857
MD5 54fe2880b06d5649e942935d3ae19610
BLAKE2b-256 e924a3057418c7f214b9c00a5ec5a58d835d50386a2138a5b8eb79eb86a98426

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b02e7fa03cd4059dd61ff0600080a5a9e7a893a85cb8e5178943533656eec65e
MD5 e1188ea693c1d7089e79d111b4424c63
BLAKE2b-256 fd2f96be308017b40e7c1678e698539e10f48df731a045302320277ca2d111ab

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 0f9a22fff1745e2bb930b1e971c4c5b67ea3b38ae17a6adb9019371f80961219
MD5 e6412cd189ece73a250d3d713ea5c31a
BLAKE2b-256 94154ae12ea86c9474fbef3d8212b910cfb4eaa230414453372a3d6b61f6ce12

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e0d8fdfebc50ac7569358f5c75f2b98bb473befccf9498cf23b3e39993bb45a
MD5 fc6102c9269f84d1d0ac55ff7d1aa916
BLAKE2b-256 d68bd302a694e6536bf394d06bdaecf4c0d826a4e19e473cbbc6df6c3aa3d498

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 548d6b42303d40264118178053c78820533b683b20dfbb254a8706ca48467357
MD5 7800132ae7b3a91364d742d0fe057318
BLAKE2b-256 1ec4ac0a3f3cd09583a2804115f239dc7137dab091b9acd0e05afd157167be11

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 9fb12a5e2b42e0b53769455ff93546e6bc9ab14007fbd436978d827a95ca5bd1
MD5 2ca049c7b26d8b761ee9f57325841a1d
BLAKE2b-256 1a9aa982f5a85f723675386cb73d3073a71c3909e6bffd7ab58210900dc81ab6

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 9a26272ef3e930330fc0c2c148cc29706cc2c40d25760c7ccea8d768a8feef8b
MD5 2249f36d3dd378cff05d8daea3df7911
BLAKE2b-256 0dcdc56790d9aec7e9339429f1810be053c15c732ff44d0cffaedbbe1ae29160

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c541e0f2c3e95e83e4f84561c893284ba984e9d0025352057396d96dceb09f44
MD5 065b50cac8a678f5cc7764dea2fad068
BLAKE2b-256 8f01ade9efdfe8320ca9bf917cf2c783348fe34ed057049cc2e4eb73586a94c7

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 e2b2bdd26bf8d6ed90763e6020b475f7634f919dbd1730ea1b6f8cb88e21de5d
MD5 9e9104f54ab4c8860c71091c4ad57a35
BLAKE2b-256 643b1547e72727dd641fa70d8f8013b966c3a8d0a624fced58ae9c2e222ab359

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 dde79930d1b28f15994ad6613aa2865fc7a403d2bb14585a8714a53233b15717
MD5 b937516423e0eeb995a39b96112acbd6
BLAKE2b-256 ed33c98e22e2b908571757b0a74113b32b0dab293493de89866194ce3adcd631

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 888db233e06907c555eccd10da99b9cd5ed45deca47e41766954292dc9f7b198
MD5 6ca76856b39508964264f82101105c23
BLAKE2b-256 f83992d96f9615f1e1f81adb4ce0d89552b2a644553d2bd0013aabea02a74030

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cbaff354d12235002e62d9d3fa8bcf326a8490c1179aa5c17195a300a9e5952f
MD5 de5f818771607c30dfa66fc495ad0dc8
BLAKE2b-256 08d32ceeaba2ec53c166e6e2035ba68f24354b53241d7373dfb12d534bf7c737

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 bc7c726855f04f22ac79131b51bf0c9f728cb2117419ed830a43828b2c4a5fcb
MD5 07ed788b673e932ff86d31169739e981
BLAKE2b-256 22c53c09a727e227978f0e8b5ce22665ae2f7e7b1812f1b4ebdae48d2304b0c7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1b8e6db99e49cd7125d8a4c9d33c0735eea7b75a942c6ad68b75be3e91c242fb
MD5 19f841807eed7d05b98d8f3ddb0777ab
BLAKE2b-256 4e8edba0c3392d23f57ed99e3b21af63ce13c300a25a4ac9b90673b39adabb8f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 00ea0081eca5e8e695cffbc3a726bb90da77f4e3f78ce29b86f0d95db4e70ef7
MD5 615c0ae2eccbb32e356d61ef78b81f5d
BLAKE2b-256 70afcc2066d2d79cc06b304eec95b0b5ea15879c4fd2ea1cfc159cac9172ce8b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7102342d60207fa635e24c02a51c6628bf0472e5fef067f78a612386840407fc
MD5 fcff8d7692f648b029ec34247d98331d
BLAKE2b-256 973ca8127fade42a773131069238d074e16dfbc0110ac95e1ea338b93297bf88

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.18.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 9891d3c94272108bcecf5597a592e61105279def1313521e637f2d5acbe08bc9
MD5 4614e59d27f4eb14abfb34364ee16531
BLAKE2b-256 c0cd4cf84ee8b536cf0f9374996a4624f9a07c22db581811028e4264b7b24228

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