Skip to main content

Python config-manager used at Alkivi

Project description

Build Status Requirements Status

Python config-manager used at Alkivi

Package

Example

Write a conf like

[default]
; general configuration: default endpoint
endpoint=dev

[dev]
; configuration specific to 'dev' endpoint
env=dev

[prod]
; configuration specific to 'prod' endpoint
env=prod
from alkivi.config import ConfigManager
config = ConfigManager('test')

# This will look for several files, in order
# 1. Current working directory: ``./test.conf``
# 2. Current user's home directory ``~/.test.conf``
# 3. System wide configuration ``/etc/test.conf``

# Then find the endpoint
endpoint = config.get('default', endpoint)

# Or use a specific one
endpoint = 'prod'

# And then
env = config.get(endpoint, 'env')

Parameters

Tests

Testing is set up using pytest and coverage is handled with the pytest-cov plugin.

Run your tests with py.test in the root directory.

Coverage is ran by default and is set in the pytest.ini file. To see an html output of coverage open htmlcov/index.html after running the tests.

TODO

Travis CI

There is a .travis.yml file that is set up to run your tests for python 2.7 and python 3.2, should you choose to use it.

TODO

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

alkivi_config_manager-1.2.9-py2.py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 2 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