Skip to main content
Latest Version Supported Python versions Wheel status License

aionotify is a simple, asyncio-based inotify library.

Its use is quite simple:

import asyncio
import aionotify

# Setup the watcher
watcher = aionotify.Watcher()
watcher.watch(alias='logs', path='/var/log', flags=aionotify.Flags.MODIFY)

async def work():
    await watcher.setup()
    for _i in range(10):
        # Pick the 10 first events
        event = await watcher.get_event()
        print(event)
    watcher.close()

asyncio.run(work())

Events

An event is a simple object with a few attributes:

  • name: the path of the modified file

  • flags: the modification flag; use aionotify.Flags.parse() to retrieve a list of individual values.

  • alias: the alias of the watch triggering the event

  • cookie: for renames, this integer value links the “renamed from” and “renamed to” events.

Watches

aionotify uses a system of “watches”, similar to inotify.

A watch may have an alias; by default, it uses the path name:

watcher = aionotify.Watcher()
watcher.watch('/var/log', flags=aionotify.Flags.MODIFY)

# Similar to:
watcher.watch('/var/log', flags=aionotify.Flags.MODIFY, alias='/var/log')

A watch can be removed by using its alias:

watcher = aionotify.Watcher()
watcher.watch('/var/log', flags=aionotify.Flags.MODIFY)

watcher.unwatch('/var/log')

Metadata

Release files for aionotify 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aionotify 0.3.1
File Size Uploaded
aionotify-0.3.1.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aionotify 0.3.1
File Interpreter ABI Platform
aionotify-0.3.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 18.7 kB

Release files / aionotify-0.3.1.tar.gz

Download URL aionotify-0.3.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9651e1373873c75786101330e302e114f85b6e8b5ad70b491497c8b3609a8449
BLAKE2b-256 checksum
How to use checksums
231681a26a64d728e76eea073cd0316f3e8885cca312247a9ba9af64d7c47e64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / aionotify-0.3.1-py2.py3-none-any.whl

Download URL aionotify-0.3.1-py2.py3-none-any.whl
Size 7.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
25816a9eef030c774beaee22189a24e29bc43f81cebe574ef723851eaf89ddee
BLAKE2b-256 checksum
How to use checksums
6b6ab43cb72f72ad650225854b630ab569b74071764fb562b88264aed4c9e350
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page