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

Project details


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

Uploaded Source

Built Distributions

watchfiles-0.17.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.17.0-pp39-pypy39_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.2 MB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

watchfiles-0.17.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl (374.2 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.17.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.17.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.2 MB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

watchfiles-0.17.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl (373.5 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.17.0-cp37-abi3-win_arm64.whl (252.1 kB view details)

Uploaded CPython 3.7+ Windows ARM64

watchfiles-0.17.0-cp37-abi3-win_amd64.whl (259.1 kB view details)

Uploaded CPython 3.7+ Windows x86-64

watchfiles-0.17.0-cp37-abi3-win32.whl (249.7 kB view details)

Uploaded CPython 3.7+ Windows x86

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

Uploaded CPython 3.7+ musllinux: musl 1.1+ ARM64

watchfiles-0.17.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.17.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.17.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.2 MB view details)

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

watchfiles-0.17.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.17.0-cp37-abi3-macosx_11_0_arm64.whl (362.4 kB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

watchfiles-0.17.0-cp37-abi3-macosx_10_7_x86_64.whl (373.3 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for watchfiles-0.17.0.tar.gz
Algorithm Hash digest
SHA256 ae7c57ef920589a40270d5ef3216d693f4e6f8864d8fc8b6cb7885ca98ad2a61
MD5 0a68641b4ba7c53db5246a886917a40b
BLAKE2b-256 644ad3916ad0c51aaf2ce9e24a71a49ae2274009e370962852bd9de4170cbea4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.17.0-pp39-pypy39_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.17.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.17.0-cp37-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 58dc3140dcf02a8aa76464a77a093016f10e89306fec21a4814922a64f3e8b9f
MD5 fdd7f9ba90a654edfd65471710ab4082
BLAKE2b-256 278569d23f7fd0b93857a3abf1a4537136476c25dbfd88fc3b63bcf702ff48aa

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.17.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 53a2faeb121bc51bb6b960984f46901227e2e2475acc5a8d4c905a600436752d
MD5 975b791886ef5413af7b0ef4df6d6dfd
BLAKE2b-256 d6fb365af553845f0fcad9c0b2e587baf73825bd47314c7e849c8df3362d8ed4

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for watchfiles-0.17.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 b5c334cd3bc88aa4a8a1e08ec9f702b63c947211275defdc2dd79dc037fcb500
MD5 37e586372c1f7d4a5510ea57d2085e64
BLAKE2b-256 4cca626d0828ce211b08255fa87abea4fbb9d0c51988ba3bd32ddf4dd2eb0b19

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.17.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ffff3418dc753a2aed2d00200a4daeaac295c40458f8012836a65555f288be8b
MD5 17464e86e158346ef2a652ed0ad17434
BLAKE2b-256 393bdfb74ca88b5e8f149bfb6adc1159e1e165e7a9cdd1454beec04b73db74ee

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.17.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 4056398d8f6d4972fe0918707b59d4cb84470c91d3c37f0e11e5a66c2a598760
MD5 6fe667a5932b6a483ed5d4a0aa7d14e7
BLAKE2b-256 770b9bf88af4daae12b8ea9dfbc5cae83843a6fc7673f10ea568d8f4288a2abb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

Details for the file watchfiles-0.17.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.17.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 539bcdb55a487126776c9d8c011094214d1df3f9a2321a6c0b1583197309405a
MD5 9d12b135d1dbc91af0737eab9c3aab74
BLAKE2b-256 ee34a250d5dc73c7eaaaf0ec720359f3f83898411e0434c03273c8705fc22818

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.17.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c7e1ffbd03cbcb46d1b7833e10e7d6b678ab083b4e4b80db06cfff5baca3c93f
MD5 06273c05d1970eb04ee54778e52fc3fe
BLAKE2b-256 868327325bf6e86ddde518c6a51ca8b31035757ae33e6246dc4682999e902190

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