Skip to main content

Parser to read and create unit files for systemd

Project description

SystemdUnitParser

SystemdUnitParser is an extension to Python's configparser.RawConfigParser to properly parse systemd unit files

Usage

from SystemdUnitParser import SystemdUnitParser

config = SystemdUnitParser()
config.read('sample.service') # or any other systemd unit file

print(config.sections()) # get all sections of the unit file
print(config.options('Unit')) # get all options in a section
print(config.get('Unit', 'Description')) # get the actual value of an action

Contributing

  • create a fork
  • create a new branch from origin/master
  • do your patches
  • run pytest
  • push your changes to your fork and create a PR

License

This module is licensed under GPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

systemdunitparser-0.4.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

systemdunitparser-0.4-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file systemdunitparser-0.4.tar.gz.

File metadata

  • Download URL: systemdunitparser-0.4.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for systemdunitparser-0.4.tar.gz
Algorithm Hash digest
SHA256 af5fb7c0ba9d27dab044fee9b4e632149af32545f5501ada9d7ecf8529e38f9f
MD5 ca9f41e0fffc4790074f9fa0812bca46
BLAKE2b-256 845041b10851ff5f0b36832a95e8fa455483710077f10a47398d163323f5ddf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for systemdunitparser-0.4.tar.gz:

Publisher: release.yml on sgallagher/systemdunitparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file systemdunitparser-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for systemdunitparser-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 80f5529d132a829307c6cbb0eaaa80b7d675e7b27c5eec5ec822827b73c6faad
MD5 5c9f27d0bdc8f59e6f3c0e037f05bf08
BLAKE2b-256 cbb8f22eaa6309539313a4755579204787c5871f2678420b6029de5f05351032

See more details on using hashes here.

Provenance

The following attestation bundles were made for systemdunitparser-0.4-py3-none-any.whl:

Publisher: release.yml on sgallagher/systemdunitparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page