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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cd07f641347ed52b99874024ff9926e9c8fc7509073281c10ec98fbdafa147a
|
|
| MD5 |
6ae1710d49572be5921dbd2e03c7c547
|
|
| BLAKE2b-256 |
17e290c68149dee6d411236bedc283d16ca089c2e1cc1cde17e538a1c4b28a6f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2542b817977a01a9aa03225d3a12b2b8608e69b6f449187c637435c63fec67b
|
|
| MD5 |
7a0b60ea7888030fa2b1df724b0649db
|
|
| BLAKE2b-256 |
58514adffe8f35162bcaee25e96ad9664e40445582a0e26204f0296b0e1d01fb
|