Skip to main content

Python high level configuration library

Project description

pymlconf (Python YAML Configuration Library) helps to easily manage and access to your application configurations which was already Written in YAML language.

It can merge two or more configuration files according their names and automatically treat file-names as namespaces, or simply merge several parts of configuration(YAML-string or Python-dict) on arbitrary config node. for more informations see documentations.

from pymlconf import ConfigManager

config_str='''
app:
    name: MyApp
    listen:
        sock1:
            addr: 192.168.0.1
            port: 8080
    languages:
        - english
        - {language: persian, country: iran}

logfile: /var/log/myapp.log
'''

cfg = ConfigManager(init_value=config_str)

print cfg.app.name
print cfg.app.listen.sock1.addr
print cfg.app.languages[0]
print cfg.app.languages[1].country
print cfg.logfile

# --------- Prints:
# MyApp
# 192.168.0.1
# english
# iran
# /var/log/myapp.log

Installation

Latest stable version:

$ pip install pymlconf
# or
$ easy_install pymlconf

Development version:

pip install git+git@github.com:pylover/pymlconf.git

From source:

$ cd source_dir
$ python setup.py install

Syntax Reference

You can find the canonical syntax reference on PyYAML site

Documentation

[pythonhosted.org] (http://pythonhosted.org/pymlconf/) [readthedocs.org] (http://pymlconf.readthedocs.org/en/latest/)

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pymlconf-0.3.2-py2.7.egg (11.7 kB) Copy SHA256 hash SHA256 Egg 2.7 Nov 19, 2013
pymlconf-0.3.2-py3.3.egg (12.6 kB) Copy SHA256 hash SHA256 Egg 3.3 Nov 19, 2013
pymlconf-0.3.2.tar.gz (4.8 kB) Copy SHA256 hash SHA256 Source None Nov 19, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page