Home

Awatch

awatch is an asynchronous file-system watcher function that is part of the Python package watchfiles. It provides an asynchronous generator that yields events when files or directories under a specified path change. Designed for cross-platform use, awatch relies on the operating system’s native file-watching facilities and can monitor directories recursively to track nested changes.

The primary purpose of awatch is to support development workflows that respond to code or asset changes,

Usage and capabilities are centered on simplicity and integration. After installing the package (for example via

Awatch is part of a broader ecosystem of file-watching tools available in Python. It aims to offer

such
as
live
reloading,
automatic
test
execution,
or
incremental
builds.
Each
yielded
change
typically
includes
the
path
involved
and
the
nature
of
the
change,
such
as
a
file
being
created,
modified,
or
deleted.
The
asynchronous
interface
makes
it
well
suited
for
integration
with
asyncio-based
tooling
and
servers.
pip),
you
import
awatch
from
watchfiles
and
use
it
within
an
asynchronous
context
or
coroutine.
A
common
pattern
is
to
loop
over
awatch
with
a
target
directory,
handling
changes
as
they
arrive.
Options
commonly
include
toggling
recursive
watching
and
filtering
certain
paths
or
patterns,
depending
on
library
version.
a
lightweight,
cross-platform
alternative
to
heavier
watchers,
with
a
focus
on
asynchronous
workflows
and
ease
of
use
in
development
environments.
See
also
related
tools
such
as
watchdog,
inotify-based
libraries,
and
platform-specific
file
watchers.