Skip to main content

Configuration helper

Project description

Configuration helper

PyPI package: ppconfig

If you spot any problems or have any improvement ideas then feel free to open an issue and I will be glad to look into it for you.

Installation

A recommended way of installing the tool is pip install.

pip install

The tool is available in PyPI and can be installed using pip:

$ pip install --user ppconfig

Configuration

By default, configuration files are searched for in ~/.config/ (this can be overridden by class argument config_dir or environment variable XDG_CONFIG_HOME). If the config directory does not exist then it will be automatically created.

Usage

Let’s say we have ~/.config/app_name with the following contents:

[default]
var1 = First Data

[section_name]
var2 = Some other random data

To read both variables from this file:

from ppconfig import Config

config = Config(config_file='app_name')

var1 = config.get('var1')
var2 = config.get('var2', section='section_name')

Project details


Download files

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

Source Distribution

ppconfig-1.0.3.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

ppconfig-1.0.3-py2.py3-none-any.whl (14.8 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