Configuration parsers with lazy parameters evaluation
Project description
ihih is an attempt to provide simple configuration parsers (for Python) with a dictionary-like interface.
It try to be flexible and let you alter the syntax by sub-classing it.
More informations can be found in the docs directory or online:
Features
“flat” configuration file format
Flat by opposition to, “nested” (like JSON, nginx, …) and “section” (INI files, …).
Simple key / value system
Simple, obvious, supporting the features you are used to (ignore blank lines and spaces, support comments, automatic unquoting, …).
Lazy value interpolation
Example:
my_banner = $myhostname MY-PROGRAM my_hostname = server.example.net
Dictionary-like interface
Example:
>>> print conf['my_banner']
server.example.net MY-PROGRAM
Configuration precedence
In the following example, user configuration file will take precedence over system-wide configuration file:
conf = IHIH(
(
'/etc/example.conf',
os.path.join(os.path.expanduser('~'), '.example.conf')
)
)
Default on the initialization
Example:
conf = IHIH(
'/etc/example.conf',
{'lang': 'en', 'TZ': 'UTC'}
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ihih-0.2.1.tar.gz
.
File metadata
- Download URL: ihih-0.2.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e4865f1d3fa0c07a81869287d24d9985a4710823cd8b2e18dd855940b64e96 |
|
MD5 | 2a91a01a00e3ec7afa39d85d679c0483 |
|
BLAKE2b-256 | 4503efbecd8b5df460bd0d2095652d8d7492abaa57476a0954e9dd5b4afb213e |
File details
Details for the file ihih-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: ihih-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a32f51795688a136d036c192ba33399c95d835bcae33febf69d983670625d96b |
|
MD5 | ee99cae4eb371b2fe2e31306ebea7abf |
|
BLAKE2b-256 | bfa274b90062227e2488b7368bf25c2cb8aa2f37ae4d97d13ff67df6d8ee265b |