skillfed

cysystemd

systemd wrapper in Cython

cysystemd v2.0.5 77.8K downloads/30d#14,495 on PyPI113
Permissive license Apache 2.0 Active released

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 cysystemd

uv

uv add cysystemd

poetry

poetry add cysystemd

Installing 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

Development Status :: 5 - Production/StableEnvironment :: No Input/Output (Daemon)Intended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: POSIX :: LinuxProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: SystemTopic :: System :: LoggingTopic :: System :: Operating SystemTopic :: System :: Systems AdministrationTyping :: Typed

Tags

systemd journal logging pythonjournald reader writersystemd daemon notificationlibsystemd python wrappersystemd integration pythonjournald async readersd_notify python
systemd-integrationjournald-logginglinux-only

More Libraries packages