cysystemd
systemd wrapper in Cython
What it is and what it does
cysystemd is a Cython wrapper around systemd's libsystemd C library, providing Python bindings for journald (the systemd journal) and systemd daemon features. It allows Python applications to write structured log entries to the system journal, read journal records with filtering and seeking, and send service notifications (READY, STOPPING, STATUS) to systemd. The package includes a logging handler for Python's standard logging module, making it easy to integrate journald into existing logging pipelines.
Version 2.0.5 is actively maintained and supports Python 3.8 through 3.14. It uses precompiled wheels for Linux x86_64 and aarch64 architectures, though source installation is recommended if you encounter compatibility issues. The package requires libsystemd development headers at build time and has no runtime Python dependencies, making it lightweight once installed.
Use it for:
- Integrate Python application logs directly into systemd journal for centralized system logging and journalctl querying
- Send daemon readiness and status notifications to systemd for proper service lifecycle management and watchdog integration
- Query and filter systemd journal entries programmatically to build monitoring, alerting, or log aggregation tools
- Implement async journal polling to stream new log entries as they arrive for real-time log processing
- Write structured metadata alongside log messages for better searchability and filtering in systemd journal
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cython-based wrapper for systemd's libsystemd library, enabling Python applications to read and write to the systemd journal, send daemon notifications, and interact with systemd services.
Yes, if you are building Python services on Linux and want native systemd integration. The package is production-stable, actively maintained, and has no security vulnerabilities. Install friction is moderate (requires system headers), but wheels are available for common configurations. Not suitable for non-Linux platforms or applications that do not need systemd interaction.
Install
cysystemd on PyPI
pip
pip install cysystemduv
uv add cysystemdpoetry
poetry add cysystemdInstalling cysystemd
Before you install
Medium install friction due to compiled C extension requiring libsystemd development headers. Wheels are provided for multiple Python versions (3.8–3.14) and architectures (x86_64, aarch64) using manylinux_2_34 format, but source installation requires system dependencies. Package is actively maintained with recent commits.
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions. No copyleft obligations.
Quickstart
# Install
pip install cysystemd
# Write to journal
from cysystemd import journal
journal.write("Hello Lennart")
journal.send(message="Structured entry", priority=journal.Priority.INFO)
# Read from journal
from cysystemd.reader import JournalReader, JournalOpenMode
reader = JournalReader()
reader.open(JournalOpenMode.SYSTEM)
reader.seek_head()
for record in reader:
print(record.data['MESSAGE'])
Requires libsystemd development headers installed on the system (libsystemd-dev on Debian/Ubuntu, systemd-devel on CentOS/RHEL). Source installation will fail without these headers.
Verify before relying
- Actual compatibility across different systemd versions and Linux distributions beyond manylinux_2_34 baseline
- Performance characteristics when reading large journal volumes or under high write load
- Whether AsyncJournalReader v2.0.0 breaking changes affect existing production deployments
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (<4,>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 163 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 77,786/month — #14,495 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cysystemd-2.0.5-cp310-cp310-manylinux_2_34_aarch64.whl; cysystemd-2.0.5-cp310-cp310-manylinux_2_34_x86_64.whl; cysystemd-2.0.5-cp311-cp311-manylinux_2_34_aarch64.whl; cysystemd-2.0.5-cp311-cp311-manylinux_2_34_x86_64.whl; cysystemd-2.0.5-cp312-cp312-manylinux_2_34_aarch64.whl; cysystemd-2.0.5-cp312-cp312-manylinux_2_34_x86_64.whl; cysystemd-2.0.5-cp313-cp313-manylinux_2_34_aarch64.whl; cysystemd-2.0.5-cp313-cp313-manylinux_2_34_x86_64.whl; cysystemd-2.0.5-cp314-cp314-manylinux_2_34_aarch64.whl; cysystemd-2.0.5-cp314-cp314-manylinux_2_34_x86_64.whl; cysystemd-2.0.5-cp38-cp38-manylinux_2_34_aarch64.whl; cysystemd-2.0.5-cp38-cp38-manylinux_2_34_x86_64.whl; cysystemd-2.0.5-cp39-cp39-manylinux_2_34_aarch64.whl; cysystemd-2.0.5-cp39-cp39-manylinux_2_34_x86_64.whl
Keywords: systemd, cython, daemon, sd_notify, sd_watchdog, journald, journal, logging, linux, asyncio, libsystemd, syslog, service, notify
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
sdnotifySends systemd service notifications (startup…
permissive · top 15,000 on PyPI
systemd-pythonProvides Python bindings to systemd's native C…
copyleft · top 5,000 on PyPI
sdbusPython library for D-Bus communication with…
copyleft · top 15,000 on PyPI
notify_pySends cross-platform desktop notifications from…
permissive · top 15,000 on PyPI
daemonizeDaemonize provides a Python library for…
permissive · top 15,000 on PyPI
auditwheelAudits and repairs Linux and Android wheel…
permissive · top 5,000 on PyPI
cibuildwheelAutomates building and testing Python wheels…
permissive · top 5,000 on PyPI
pyvips-binaryProvides pre-built binary wheels of libvips and…
copyleft · top 15,000 on PyPI
stdebConverts Python packages into Debian source and…
permissive · top 15,000 on PyPI