Skip to main content

Manage multiple and hierarchical configurations

Project description

Easy Configuration Manager for Python applications

Configuration made easy

When you need some configuration, or you need sets of configuration to correspond to more stages such as development, test and production you may want to have a single configuration set and refer to it all over your application.

Then you may want to incorporate your set of configration buckets into your CLI application.

installation

install the package on your environment

using pip:

$ pip install pyconfman

Incorporate it into your application

If you use click library to manage your application CLI there is already, pyconfman comes along with a simple function to add the config group to your application's cli.group.

For example, if your app has a command such as

import click
@click.group()
def cli():
    """My amazing application"""

if __name__ == "__main__":
    cli()

you can incorporate the confman as following:

import click
import pyconfman


@pyconfman.cli
@click.group()
def cli():
    """My amazing application"""


if __name__ == "__main__":
    cli()

This adds the configuration manager to your command line interface

Usage and command line

$ myapp --help

Usage: myapp [OPTIONS] COMMAND [ARGS]...

Options:
  -C, --conf-dir TEXT  configuration directory: [~/.config/<myapp>]
  --help               Show this message and exit.

Commands:
  config  Read or modify configuration files.
  ...
  ...

Get configs on the spot

Usage: myapp config [OPTIONS] COMMAND [ARGS]...

  Read or modify configuration files.

Options:
  --help  Show this message and exit.

Commands:
  get   Print out configuration information.
  load  Load a full configuration storage from `path_to_json` file.
  set   Set a single value on a configuration storage

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

pyconfman-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyconfman-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pyconfman-0.1.0.tar.gz.

File metadata

  • Download URL: pyconfman-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Darwin/22.5.0

File hashes

Hashes for pyconfman-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3cd07f641347ed52b99874024ff9926e9c8fc7509073281c10ec98fbdafa147a
MD5 6ae1710d49572be5921dbd2e03c7c547
BLAKE2b-256 17e290c68149dee6d411236bedc283d16ca089c2e1cc1cde17e538a1c4b28a6f

See more details on using hashes here.

File details

Details for the file pyconfman-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyconfman-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Darwin/22.5.0

File hashes

Hashes for pyconfman-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2542b817977a01a9aa03225d3a12b2b8608e69b6f449187c637435c63fec67b
MD5 7a0b60ea7888030fa2b1df724b0649db
BLAKE2b-256 58514adffe8f35162bcaee25e96ad9664e40445582a0e26204f0296b0e1d01fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page