Skip to main content

config utility.

Project description

# os-config

[![Build Status](](
[![PyPI - Python Version](](

Config utility.

In python world, it is common to use an object as config. But normal object lacks of some useful features for config purpose. This library offers an ``Config`` object which support create, update, attribute access, etc. Consider the usability and complexity in real programming work, config attribute types are limited into: ``int``, ``long``, ``float``, ``NoneType``, ``bool``, ``str``, ``unicode``, ``tuple`` and ``Config``. ``list``, ``dict`` will convert to ``tuple`` and ``Config``.

# Install

`pip install os-config`

# Usage

* create an empty config
from os_config import Config
config = Config.create()

* create from params
config = Config.create(a=1, b=2)
assert config.a == 1
assert config.b == 2

* create from dict
config = Config.from_dict({'a':1, 'b':2})

* create from json
json_string = '{"a": 1, "b": 2}'
config = Config.from_json(json_string)

* update from another config/dict
config1 = Config.create(a=1)
config2 = Config.create(a=2, b=3)
Config.update(config2, config1)

# Unit Tests

`$ tox`

# License

MIT licensed.

Project details

Download files

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

Files for os-config, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size os-config-0.2.3.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page