Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 1.5 KB

README.md

File metadata and controls

21 lines (13 loc) · 1.5 KB

systemd_ctypes

A small pure-ctypes wrapper around libsystemd.

This depends on at least libsystemd 239, which was released on 2018-06-22.

This project aims to build a small wrapper around libsystemd based on ctypes, using semi-automated binding techniques. The highlevel goals are:

  • easy to embed in other projects (eg: in zipapp packages)
  • small code size with little binding-related boilerplate: in many cases, one line per bound function
  • reasonable performance, but not at the cost of readability
  • seemless integration of systemd's event loop with asyncio, including async/await.

The initial focus is on the sd_event and sd_bus APIs.

There's a higher-level PathWatch API to make it easier to use inotify.

Check the examples and tests for how to use systemd_ctypes.

This project originated as a weekend hack to support the efforts to write a portable Python version of cockpit-bridge.

Run tests with pytest or tox.