Skip to main content

Forget about configparser, YAML, or JSON parsers. Focus on configuration.

Project description

https://travis-ci.org/jbasko/configmanager.svg?branch=master

Don’t let standard library’s configparser drive your configuration value access design. Let it do what it does best – parse and write configuration files. And let configmanager do the rest.

Main Features

  • Every configuration item is an object with a type, a default value, a custom value and other metadata
  • No sections required
  • Any depth of sections allowed
  • INI (ConfigParser), JSON, YAML formats
  • click framework integration

Source Code and Issue Tracking

https://github.com/jbasko/configmanager

Quick Start

Install from Python Package index with pip install configmanager.

Declare your configuration, the sources, and off you go. Remember, every configuration item is an object, not just a plain configuration value. If you don’t need the rich features of configuration items, use configmanager.PlainConfig instead.

import warnings
from configmanager import Config

config = Config({
    'uploads': {
        'threads': 1,
        'enabled': False,
        'db': {
            'user': 'root',
            'password': {
                '@default': 'root',
                '@envvar': 'MY_UPLOADER_DB_PASSWORD',
            },
        }
    }
}, load_sources=[
    '/etc/my-uploader/config.ini',
    '~/.config/my-uploader/config.json',
], auto_load=True)

if config.uploads.db.user.is_default:
    warnings.warn('Using default db user!')

if config.uploads.enabled.get():
    connect_to_database(
        user=config.uploads.db.user.get(),
        password=config.uploads.db.password.get(),
    )

Project details


Release history Release notifications

This version
History Node

1.34.0

History Node

1.32.1

History Node

1.32.0

History Node

1.31.0

History Node

1.30.0

History Node

1.29.2

History Node

1.29.1

History Node

1.29.0

History Node

1.28.0

History Node

1.27.0

History Node

1.26.2

History Node

1.26.0

History Node

1.25.0

History Node

1.24.3

History Node

1.24.2

History Node

1.24.1

History Node

1.24.0

History Node

1.23.0

History Node

1.20.1

History Node

1.20.0

History Node

1.19.0

History Node

1.18.0

History Node

1.17.0

History Node

1.16.0

History Node

1.15.0

History Node

1.14.4

History Node

1.14.3

History Node

1.14.2

History Node

1.14.1

History Node

1.14.0

History Node

1.13.0

History Node

1.12.1

History Node

1.12.0

History Node

1.11.2

History Node

1.11.1

History Node

1.11.0

History Node

1.10.0

History Node

1.9.1

History Node

1.9.0

History Node

1.8.7

History Node

1.8.6

History Node

1.8.5

History Node

1.8.4

History Node

1.8.3

History Node

1.8.2

History Node

1.8.1

History Node

1.7.0

History Node

1.6.2

History Node

1.6.1

History Node

1.6.0

History Node

1.5.4

History Node

1.5.3

History Node

1.5.2

History Node

1.5.1

History Node

1.5.0

History Node

1.4.0

History Node

1.3.0

History Node

1.2.0

History Node

1.1.14

History Node

1.1.13

History Node

1.1.12

History Node

1.1.0

History Node

1.0.0

History Node

0.0.24

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
configmanager-1.34.0.tar.gz (55.1 kB) Copy SHA256 hash SHA256 Source None Jan 16, 2018

Supported by

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