Skip to main content

asyncinotify wrapper for z/OS

Project Status: Active – The project has reached a stable, usable state and is being actively developed. builds.sr.ht status z/OS

Due to z/OS-specific DLL constraints, asyncinotify needs this tiny wrapper written in C.

Install

A C compiler is required to install this package from source. See this page for supported compilers and required environment variables to use them.

# Install from PyPI
pip3 install asyncinotify_zos
# Install from source
pip3 install asyncinotify_zos_<version>.tar.gz

Why is it needed?

Python can load C functions from files in the Unix filesystem hierarchy. Unfortunately, on z/OS most functions are not located in Unix files but in MVS data sets. As of April 2026, Python on z/OS is not able to load functions directly from MVS data sets.

There is an idea (PY-I-14) already opened for IBM to implement an alternative loader so that Python can load functions from MVS data sets. Once this functionality is implemented, this wrapper will no longer be necessary. Note that this will also require modifications to the asyncinotify upstream package.

Quickstart

Using asyncinotify is very simple:

from pathlib import Path
from asyncinotify import Inotify, Mask
import asyncio

async def main():
    # Context manager to close the inotify handle after use
    with Inotify() as inotify:
        # Adding the watch can also be done outside of the context manager.
        # __enter__ doesn't actually do anything except return self.
        # This returns an asyncinotify.inotify.Watch instance
        inotify.add_watch('/tmp', Mask.ACCESS | Mask.MODIFY | Mask.OPEN | Mask.CREATE | Mask.DELETE | Mask.ATTRIB | Mask.CLOSE | Mask.MOVE | Mask.ONLYDIR)
        # Iterate events forever, yielding them one at a time
        async for event in inotify:
            # Events have a helpful __repr__.  They also have a reference to
            # their Watch instance.
            print(event)

            # the contained path may or may not be valid UTF-8.  See the note
            # below
            print(repr(event.path))

asyncio.run(main())

This will asynchronously watch the /tmp directory and report events it encounters.

Metadata

Release files for asyncinotify-zos 0.2.5

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

Source distribution (sdist)

Source distribution for asyncinotify-zos 0.2.5
File Size Uploaded Provenance Actions
asyncinotify_zos-0.2.5.tar.gz 15.4 kB Without provenance Details for asyncinotify_zos-0.2.5.tar.gz

Release files / asyncinotify_zos-0.2.5.tar.gz

Download URL asyncinotify_zos-0.2.5.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
325116c203c7a4a2ef9221784ae23e8024974e43ff5bec2ee31561f38bde20e7
BLAKE2b-256 checksum
How to use checksums
4d58f0aab4df698cc7e0ffb86932e38bbe165dbed01edce7f971372a0c99d285
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.13 Linux/6.12.81-0-lts

Security for asyncinotify-zos 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.5 This release

1 release file No provenance

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