Skip to main content

udisks-monitor

Event-driven pub/sub wrapper around udisksctl monitor (Linux).

PyPI version Python License OS

CI codecov

Downloads total Downloads/month Downloads/week

One lightweight dependency (strip-ansi). Parses the human-readable output of udisksctl monitor into typed event dataclasses with wall-clock timestamps, dispatching to subscribers via an in-process event bus.

Install

pip install udisks-monitor

Quickstart

from udisks_monitor import UdisksMonitor, DevicePropertyChanged, JobProperties

mon = UdisksMonitor()

# Subscribe by event type and filter
@mon.on(DevicePropertyChanged, device='loop0', property_='BackingFile')
def on_backing(evt):
    if not evt.value:
        print(f"{evt.device_name} detached")

@mon.on(JobProperties, operation='filesystem-mount')
def on_mount(evt):
    print(f"mount job for {evt.objects}")

mon.start()
mon.join()

Events

Event When
DevicePropertyChanged A property on any device interface changed
InterfaceAdded A D-Bus interface appeared on a device
InterfaceRemoved A D-Bus interface was removed
JobAdded A UDisks2 job was created
JobProperties The operation and target objects of a job
JobCompleted A job finished (success/failure)
JobRemoved A job object was torn down

All events carry a timestamp: str field with the HH:MM:SS.mmm wall-clock time from udisksctl monitor.

Subscription filters

bus = EventBus()

# By event type
bus.subscribe(fn, event_type=DevicePropertyChanged)

# By operation string (matches JobProperties with that operation)
bus.subscribe(fn, event_type='filesystem-mount')

# By device name
bus.subscribe(fn, device='loop0')

# By D-Bus interface
bus.subscribe(fn, interface='org.freedesktop.UDisks2.Loop')

# By property name
bus.subscribe(fn, property_='BackingFile')

# Combined
bus.subscribe(fn,
    event_type=DevicePropertyChanged,
    device='loop0',
    property_='MountPoints')

# Decorator style
@bus.on(DevicePropertyChanged, device='loop0', property_='BackingFile')
def handler(evt): ...

Nix

{
  inputs.udisks-monitor.url = "github:MBanucu/udisks-monitor";
}

License

GPL-3.0-only

Metadata

Release files for udisks-monitor 0.3.0

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

Source distribution (sdist)

Source distribution for udisks-monitor 0.3.0
File Size Uploaded Provenance Actions
udisks_monitor-0.3.0.tar.gz 28.9 kB With provenance Details for udisks_monitor-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for udisks-monitor 0.3.0
File Interpreter ABI Platform Actions
udisks_monitor-0.3.0-py3-none-any.whl Python 3 none any Details for udisks_monitor-0.3.0-py3-none-any.whl

Total release size: 53.9 kB

Release files / udisks_monitor-0.3.0.tar.gz

Download URL udisks_monitor-0.3.0.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7aa1464fa37c1dc20ca995a6679f07774a2d6a887e8d8e8aa6a819e6d40199de
BLAKE2b-256 checksum
How to use checksums
791f21244d744e4c3c974758a064851da584b96922811dd3a809831272ec4e19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / udisks_monitor-0.3.0-py3-none-any.whl

Download URL udisks_monitor-0.3.0-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
933d99c2afa733a807631f29e930a9b85d2aec346172c3c92c0fd0db66da118c
BLAKE2b-256 checksum
How to use checksums
5f4f356f0072a71512b4b5e8baf02cb1916e159c4436b98cfe34bed06762fdbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Security for udisks-monitor 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for udisks_monitor-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

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.

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