Skip to main content

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


Download files

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

Source Distribution

ihih-0.2.1.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

ihih-0.2.1-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

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