https://github.com/gahjelle/pyconfs
Unified handling of configuration files in Python
https://github.com/gahjelle/pyconfs
configuration ini json python toml yaml
Last synced: 8 months ago
JSON representation
Unified handling of configuration files in Python
- Host: GitHub
- URL: https://github.com/gahjelle/pyconfs
- Owner: gahjelle
- License: mit
- Created: 2019-10-16T09:27:55.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2021-10-20T12:18:00.000Z (over 4 years ago)
- Last Synced: 2025-06-11T13:19:46.244Z (about 1 year ago)
- Topics: configuration, ini, json, python, toml, yaml
- Language: Python
- Homepage: https://pypi.org/project/pyconfs/
- Size: 113 KB
- Stars: 17
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# PyConfs
_Unified handling of configuration files in Python_
[](https://pypi.org/project/pyconfs/)
[](https://pypi.org/project/pyconfs/)
[](https://github.com/psf/black)
[](https://interrogate.readthedocs.io/)
[](https://github.com/gahjelle/pyconfs/actions)
> **Note:** For new projects, use [Configaroo](https://github.com/gahjelle/configaroo) instead.
## Installing PyConfs
PyConfs is available at [PyPI](https://pypi.org/project/pyconfs/). You can install it using Pip:
$ python -m pip install pyconfs
## Using PyConfs
A **PyConfs Configuration** is a dictionary-like object that unifies several different configuration file formats, including INI, JSON, TOML, and YAML.
**Read a configuration from file**:
from pyconfs import Configuration
cfg = Configuration.from_file("sample.json")
**Access entries in a configuration**:
package_name = cfg.name
first_name = cfg.author.firstname
## Installing From Source
You can always download the [latest version of PyConfs from GitHub](https://github.com/gahjelle/pyconfs). PyConfs uses [Flit](https://flit.readthedocs.io/) as a setup tool.
To install PyConfs from the downloaded source, run Flit:
$ python -m flit install --deps production
If you want to change and play with the PyConfs source code, you should install it in editable mode:
$ python -m flit install --symlink