Skip to main content

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

Project description

watchfiles

CI Coverage pypi 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

watchfiles-0.16.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.16.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.16.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl (370.7 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.16.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.16.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.16.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl (370.2 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

watchfiles-0.16.0-cp37-abi3-win_arm64.whl (251.4 kB view details)

Uploaded CPython 3.7+ Windows ARM64

watchfiles-0.16.0-cp37-abi3-win_amd64.whl (258.3 kB view details)

Uploaded CPython 3.7+ Windows x86-64

watchfiles-0.16.0-cp37-abi3-win32.whl (250.0 kB view details)

Uploaded CPython 3.7+ Windows x86

watchfiles-0.16.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.16.0-cp37-abi3-musllinux_1_1_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.1+ ARM64

watchfiles-0.16.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.16.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.16.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.16.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.16.0-cp37-abi3-macosx_11_0_arm64.whl (359.4 kB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

watchfiles-0.16.0-cp37-abi3-macosx_10_7_x86_64.whl (369.5 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.16.0-cp37-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 750e40db5efcf3f5f11602dbc6fdf8e96a0eefdbccd271093efe9fa2e9d02ed2
MD5 7d4c394aac2fb4546f157664b047422e
BLAKE2b-256 d8e446a6111709dda2148fd5619bed2c77efe520a3c18201167e999591c06691

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.16.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 059bd9596429f8c13604b2eb30888a5661b3c79099edc506f11b63be7afe3ca4
MD5 bdd73dded968ef00184520973be89eb9
BLAKE2b-256 6231b357881a35ea4c93396e3d3300b84ac5cda52d4857af3f881d3160a1189e

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for watchfiles-0.16.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 cbdb7814ca43f85ab8569206ab2c3bcd51dd5d1ba582914246784414e6ada62e
MD5 d701362328afdbc3ef0ea20924713804
BLAKE2b-256 139eaf690dcc809558723881af67fcfa99f15e7aade0acdd2b2ee9765c8b4994

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.16.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7c80e3907d21ca3f1689f42632d239fdc40ffc1d5f32f564997480f85e94c474
MD5 423f82988ad4c623be8efe0782fdf451
BLAKE2b-256 17fe15704508a3d5e2a880f8efbba5e06511586fe99b7cc6c75be9dddd33617a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.16.0-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 43d1d517faffa8955c2da0e6f64268e38442d43b50ca73cb686df25f891e49a1
MD5 77399e00626dde7bb7a8da0c6b4d745e
BLAKE2b-256 08836cd2097ae756f57bb2ab0eec3fb460ee935b73a5a966655c2119611df7c2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

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

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.16.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5fa786d102e7eabef22b2147af531aa70194aabcb35335be81c07c26382b0050
MD5 fa28472b24c6ff77334b3c08be45133c
BLAKE2b-256 7187798d529ae81a5cb837ea8c3740c48fe0cb1f2296ce3da17f3e26a9f51c71

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for watchfiles-0.16.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8d635dcba3aab2909bf568765547696d7465d30e2e9c6f5ab99da877b58d29bb
MD5 7e381e2d5c41e7889105475bafa530cd
BLAKE2b-256 4cc5586fbca85087dac64ef56791813d760a96bb42b6d3e22c65539ff071f9c9

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