systemd-python
Python interface for libsystemd
Decision gist · record as of 2026-08-14
Yes, if you are writing systemd-integrated services on Linux and need native journal access or daemon integration. The package is actively maintained and has no known vulnerabilities. However, the high install friction (requires libsystemd dev headers and compilation) and the lack of recent PyPI releases mean you should prefer distribution packages where available. Not suitable for non-systemd systems or cross-platform Python applications.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires libsystemd development headers and C compiler installed; on Debian/Ubuntu: apt install libsystemd-dev gcc python3-dev pkg-config; on Fedora: dnf install systemd-devel gcc python3-devel.
- High install friction: requires compilation against libsystemd development headers and system libraries.
- The package is actively maintained (last commit 2026-06-19) but has not had a PyPI release since 2023-02-11, so building from source is often necessary.
License · maintenance · safety
LGPLv2+ (copyleft) — Licensed under LGPLv2+, a copyleft license. Derivative works and modifications must be distributed under compatible terms, and source code must be made available to recipients.
last release 2023-02-11 (1280 days) · last repo commit 2026-06-19 · 521 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 954,641 downloads/mo, #4,649 on PyPI
Alternatives
Verify before relying
from systemd import journal
journal.send('Hello world')
journal.send('Message', FIELD='value')
from systemd import journal
from datetime import datetime, timedelta
j = journal.Reader()
j.seek_realtime(datetime.now() - timedelta(minutes=20))
for entry in j:
print(entry['MESSAGE'])- Whether the package works on non-systemd Linux distributions or other Unix-like systems.
- Current Python version support range (classifiers list both Python 2 and 3, but Python 2 is EOL).
- Whether prebuilt wheels are available for common distributions or if source compilation is always required.
What it is and what it does
systemd-python is a native Python interface to systemd's C libraries on Linux. It wraps four main systemd subsystems: journal (sending structured messages and reading journal files), daemon (socket activation and daemon utilities), id128 (machine and boot identifiers), and login (querying sessions, users, and seats). The package is designed for applications that need to integrate deeply with systemd's logging and service infrastructure.
The module is typically installed via distribution packages (dnf, apt, pacman, zypper) rather than PyPI, since it requires compilation against system libsystemd headers. When building from source, you must have the systemd development libraries and a C compiler available. Once installed, it allows Python code to send structured log entries to the journal, read journal entries with filtering and time-based queries, and query systemd's session and machine metadata—all without shelling out to journalctl or other command-line tools.
Use it for
- Send structured application logs directly to systemd journal with custom fields instead of writing to files.
- Read and filter systemd journal entries programmatically by executable, process ID, unit name, or time range.
- Integrate Python daemons with systemd socket activation and service lifecycle management.
- Query machine identifiers, boot IDs, and systemd message catalog entries for system introspection.
- Route Python logging framework output to systemd journal using the provided JournalHandler.
- Query active login sessions, users, and seats on a systemd-managed system.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are writing systemd-integrated services on Linux and need native journal access or daemon integration.
The package is actively maintained and has no known vulnerabilities. However, the high install friction (requires libsystemd dev headers and compilation) and the lack of recent PyPI releases mean you should prefer distribution packages where available. Not suitable for non-systemd systems or cross-platform Python applications.
Install
systemd-python on PyPI
Before you install
High install friction: requires compilation against libsystemd development headers and system libraries. The package is actively maintained (last commit 2026-06-19) but has not had a PyPI release since 2023-02-11, so building from source is often necessary. Distribution packages (dnf, apt, pacman) are recommended where available.
Requires libsystemd development headers and C compiler installed; on Debian/Ubuntu: apt install libsystemd-dev gcc python3-dev pkg-config; on Fedora: dnf install systemd-devel gcc python3-devel.
License in practice
Licensed under LGPLv2+, a copyleft license. Derivative works and modifications must be distributed under compatible terms, and source code must be made available to recipients.
Quickstart
from systemd import journal
journal.send('Hello world')
journal.send('Message', FIELD='value')
from systemd import journal
from datetime import datetime, timedelta
j = journal.Reader()
j.seek_realtime(datetime.now() - timedelta(minutes=20))
for entry in j:
print(entry['MESSAGE'])
Verify before relying
- Whether the package works on non-systemd Linux distributions or other Unix-like systems.
- Current Python version support range (classifiers list both Python 2 and 3, but Python 2 is EOL).
- Whether prebuilt wheels are available for common distributions or if source compilation is always required.
Package facts
| License | LGPLv2+ copyleft |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Actively maintained 1,280 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 954,641 / month, #4,649 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Programming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Logging |
Evidence: systemd-python-235.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “systemd journal logging python”
- systemd-pythonProvides Python bindings to systemd's native C libraries for journal…
- cysystemdCython-based wrapper for systemd's libsystemd library, enabling…
- oslo.serviceoslo.service provides a framework for building and running…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also cysystemd · sdbus · sdnotify · pycups · lib-log-rich · pid · daemonize · python-logging-loki · xrootd · certifi-linux