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 details)

Uploaded Source

Built Distribution

ppconfig-1.0.3-py2.py3-none-any.whl (14.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ppconfig-1.0.3.tar.gz.

File metadata

  • Download URL: ppconfig-1.0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for ppconfig-1.0.3.tar.gz
Algorithm Hash digest
SHA256 417a3f4ef4d3db1721a3c6f05a423fbbb4c8b5aa7c1132827f9f14f862cc9ca0
MD5 8af465d4a20d570dd1f646685805b3a6
BLAKE2b-256 7e123dd6a12f46b6f765c83203aeec8f0d2ce1722ac7a51dd24e71155ad14fa2

See more details on using hashes here.

File details

Details for the file ppconfig-1.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: ppconfig-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for ppconfig-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 770dc0829e3d3d80c48440211105a0fa8900049e1734eec8c86895cfbbdf0e56
MD5 2987f308f4259479f7bebab4f4577a5c
BLAKE2b-256 961975b7d1c315ad6f448bc2bb61432bb05006303ffc6bac42d58706a9edda4c

See more details on using hashes here.

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