Skip to main content

configobjectify

CI PyPI version

A lightweight Python library that provides an object-oriented interface for accessing values from INI configuration files. Instead of retrieving values using dictionary-style or section-based lookups, you can access configuration keys through dot notation.

Installation

pip install configobjectify

Usage

Consider the following config.ini file,

[APPLE]
device_name = iPhone
model = iPhone 17
os_version = 26.0

[GOOGLE]
device_name = Pixel
model = Pixel 10
os_version = 16
>>> from configobjectify import Config
>>> config = Config("config.ini", "APPLE")
>>> config.device_name.value
'iPhone'
>>> config.model.value
'iPhone 17'
>>> config.os_version.value
'26.0'

Selecting a different section

>>> config = Config("config.ini", "GOOGLE")
>>> config.device_name.value
'Pixel'
>>> config.model.value
'Pixel 10'
>>> config.os_version.value
'16.0'

NOTE: Section names are normalized to uppercase by the library before lookup.

Handling missing configuration keys

>>> config = Config("config.ini", "APPLE")
>>> config.country_of_origin.value  # returns an empty string
>>> ''

Accessing Invalid Python identifies/keywords with Normalized Keys

Consider the below configuration file.

[APPLE]
device.name = iPhone
class = First
os version = 26.0
model-name = iPhone17
  • Hyphens, periods and whitespace are normalized to underscores.
  • Python keywords are prefixed with an underscore.
>>> config = Config("config.ini", "APPLE")
>>> config.device_name.value
'iPhone'
>>> config._class.value
'First'
>>> config.os_version.value
'26.0'
>>> config.model_name.value
'iPhone17'

Installed version

To get to know the version of configobjectify,

>>> import configobjectify
>>> print(configobjectify.__version__)

or

>>> from configobjectify import __version__
>>> print(__version__)

Requirements

  • Python 3.12 or later

Contributing

Contributions, bug reports, and feature suggestions are welcome. Please open an issue to discuss a proposed change before submitting a pull request.

License

This package is distributed under the terms of MIT license

Metadata

Release files for configobjectify 0.3.0

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

Source distribution (sdist)

Source distribution for configobjectify 0.3.0
File Size Uploaded Provenance Actions
configobjectify-0.3.0.tar.gz 5.2 kB Without provenance Details for configobjectify-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for configobjectify 0.3.0
File Interpreter ABI Platform Actions
configobjectify-0.3.0-py3-none-any.whl Python 3 none any Details for configobjectify-0.3.0-py3-none-any.whl

Total release size: 10.2 kB

Release files / configobjectify-0.3.0.tar.gz

Download URL configobjectify-0.3.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cf69e517c7ce2e3ab89af278e124e03414bdcda61cfdd2762b5a25677057cf54
BLAKE2b-256 checksum
How to use checksums
4b693b5515c177b2446bb4dc2ccab18473273d8ef848fee81d228d686b324d2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / configobjectify-0.3.0-py3-none-any.whl

Download URL configobjectify-0.3.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23eea9f08d5f210aca926c3fb1f67649dd0562d082a1cf8d9341d591bc6932dc
BLAKE2b-256 checksum
How to use checksums
3c663669bf4c5dbf612c3aeec05e860bf250d8261b470c6bd18a56be50d328dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for configobjectify 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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