{"id":23487,"library":"cysystemd","title":"cysystemd","description":"A Python library providing Cython-based bindings for systemd journal and socket activation. Current version 2.0.5, supporting Python 3.8–3.12. Released under MIT license.","status":"active","version":"2.0.5","language":"python","source_language":"en","source_url":"https://github.com/mosquito/cysystemd","tags":["systemd","journal","cython","linux","logging"],"install":[{"cmd":"pip install cysystemd","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"wrong":"from cysystemd.journal import Journal","symbol":"Journal","correct":"from cysystemd import Journal"}],"quickstart":{"code":"import os\nfrom cysystemd.journal import Journal, journal_send\n\n# Send a message to systemd journal\njournal_send(\"Hello from cysystemd\", PRIORITY=6, SYSLOG_IDENTIFIER=\"myapp\")\n\n# Read from journal\nwith Journal() as journal:\n    journal.seek_tail()\n    journal.previous()\n    entry = journal.get_next()\n    print(entry.get('MESSAGE', 'No message'))","lang":"python","description":"Send and read systemd journal messages."},"warnings":[{"fix":"Always check if entry is not None before accessing.","message":"Journal.get_next() returns None when no more entries. Code must handle this.","severity":"gotcha","affected_versions":"all"},{"fix":"Use from cysystemd.journal import ... instead of from systemd.journal import ...","message":"In version 2.0.0, the module structure changed. Old imports from 'systemd.journal' no longer work.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Wrap imports in try/except ImportError or run only on systemd-based systems.","message":"The library requires systemd runtime (e.g., /run/systemd/journal/socket). Importing on non-Linux or without systemd raises ImportError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use journal_send() instead.","message":"sd_journal_sendv() is deprecated in favor of journal_send().","severity":"deprecated","affected_versions":">=1.5.0"}],"env_vars":null,"search_vec":"'2.0.5':18 '3.12':22 '3.8':21 'activ':15 'base':8 'bind':9 'current':16 'cysystemd':1 'cython':7,29 'cython-bas':6 'journal':12,28 'librari':4 'licens':26 'linux':30 'log':31 'mit':25 'provid':5 'python':3,20 'releas':23 'socket':14 'support':19 'systemd':11,27 'version':17","created_at":"2026-05-01T08:08:02.214330+00:00","updated_at":"2026-05-01T08:08:02.214330+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'Journal' from 'cysystemd' (/tmp/tmp22likvws/venv/lib/python3.12/site-packages/cysystemd/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.0.5","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/mosquito/cysystemd","docs":null,"changelog":"https://github.com/mosquito/cysystemd/releases","pypi":"https://pypi.org/project/cysystemd/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}