Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

simple key-value configuration parsers with a dictionary-like interface

License

Notifications You must be signed in to change notification settings

romain-dartigues/python-ihih

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ihih

warning:This project has been moved to GitLab <https://gitlab.com/romain-dartigues/python-ihih> Any further developpment happen there (such as Python 3 support).

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'}
)

About

simple key-value configuration parsers with a dictionary-like interface

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published