Skip to main content

Utility functions and classes for .ini style configuration files.

Latest release 20220606: HasConfigIni: new info_dict() method (name subject to change) to return a descriptive dict, part of a new scheme I'm trying out to report summary data from commands.

Class ConfigSectionWatcher(collections.abc.Mapping, collections.abc.Collection, collections.abc.Sized, collections.abc.Iterable, collections.abc.Container)

A class for monitoring a particular clause in a config file.

Method ConfigSectionWatcher.__init__(self, config, section, defaults=None): Initialise a ConfigSectionWatcher to monitor a particular section of a config file. config: path of config file or ConfigWatcher section: the section to watch defaults: the defaults section to use, default 'DEFAULT'

Class ConfigWatcher(collections.abc.Mapping, collections.abc.Collection, collections.abc.Sized, collections.abc.Iterable, collections.abc.Container)

A monitor for a windows style .ini file. The current SafeConfigParser object is presented as the .config property.

Class HasConfigIni

Class for objects with a config.ini file. A section of the config is designated "our" configuration and its fields parsed into a TagSet; in particular the field values use the TagSet transcription syntax.

The default implementation is expected to be mixed into a class with a .pathto(rpath) method, such as one which inherits from HasFSPath.

The mixin provides the following attributes:

  • config: an on demand property which is a TagSet made from the configuration file section
  • config_ini: the relative path to the configuration file
  • configpath: the full pathname of the configuration file
  • config_flush(): update the configuration file if the tags have been modified

Method HasConfigIni.__init__(self, section, config_ini=None): Initialise the configuration.

Function load_config(config_path, parser=None)

Load a configuration from the named config_path.

If parser is missing or None, use SafeConfigParser (just ConfigParser in Python 3). Return the parser.

Release Log

Release 20220606: HasConfigIni: new info_dict() method (name subject to change) to return a descriptive dict, part of a new scheme I'm trying out to report summary data from commands.

Release 20220430: New HasConfigIni mixin for classes keeping some configuration in a .ini config file section.

Release 20210306: Fix imports from collections.abc.

Release 20190101: Internal changes.

Release 20160828: Update metadata with "install_requires" instead of "requires".

Release 20150118: Initial PyPI release.

Release files for cs-configutils 20220606

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cs-configutils 20220606
File Size Uploaded
cs.configutils-20220606.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cs-configutils 20220606
File Interpreter ABI Platform
cs.configutils-20220606-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / cs.configutils-20220606.tar.gz

Download URL cs.configutils-20220606.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
44586c117ed636f7cc01214acbb99fcb237039f5af757a18ec99df64327578bb
BLAKE2b-256 checksum
How to use checksums
621047db103fec0cb74427fb8faabf9a69d0de37003bac2d274b44cf7a491181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.13

Release files / cs.configutils-20220606-py3-none-any.whl

Download URL cs.configutils-20220606-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60c26018b755a6401e04dbc953477a651afcd900fbc451f33f7bf43242c057db
BLAKE2b-256 checksum
How to use checksums
0f47d2e621103ca14befe0dc135969980c256060625ce8cd30b312d710791a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.13

Release history Release notifications | RSS feed

This release

20220606 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page