Skip to main content

A Config Management CLI Tool similar to dynaconf for python 2 and above

=============================================================================

The library provides a basic cli tool config_py2 to initialize a config mechanism in the current directory

Once installed you can run the --help to see the list of commands and options supported.

Please note that although the validation is missing currently, it will be supported in future releases.

$ config_py2 --help

Usage: config_py2 [OPTIONS] COMMAND [ARGS]

Options:
  --version         Show config_py2 version currently installed
  --help            Show this message and exit

Commands:
  init              Inits a config_py2 project. Default behavior of using `settings.toml` can be overriden with [ARGS]      
  list              Lists all defined config values

Args:   Optionally use EITHER one of these in conjunction with `init` command
  -f, --filename    Pass one or more of this followed by a filename (with extension) to give a list of file(s) to use for config
  -t, --filetype    Pass one or more of this followed by a filetype (extension) to use for settings file.
                    Possible values are: [toml | json | yaml]
                    Please note that this option will not be used if filenames are passed via the -f, --filename flag       
  -e, --env_prefix  Pass this option to override the ENV_PREFIX that will be used to override configs with the shell variables
                    Format of environment variables will be `ENV_PREFIX_{}`. By default it is set to 'CONFIG'

Examples to get you started with the init command

# Initializes a config_manager.py and settings.toml with placeholders for various environments
$ config_py2 init
Configuring your environment. Please Wait !


# Initializes a config_manager.py and settings.json with placeholders for various environments
$ config_py2 init -t json
Configuring your environment. Please Wait !


# Initializes a config_manager.py and settings.toml, settings-override.toml with placeholders for various environments
# Note that the configs will be read in the same order as provided during the `init` command

# Also note that the subsequent settings files don't need to have a `default` section of their own as long
# as the first file has one. This can be useful when you have seperate files for different environments

$ config_py2 init -f settings.toml -f settings-override.toml
Configuring your environment. Please Wait !


# This wil print the list of all configs as it'll be available for your application
$ config_py2 list
{
    "APP_ENV": "local",
    "CONFIG_ENVIRONMENT": "local"
}

Examples for usage in code once the config mechanism is initialized via the cli-tool

$ export CONFIG_ENVIROMENT=local

$ python
    >>> from config import settings
    >>> settings.APP_ENV
    'local'
    >>> settings.CONFIG_ENVIRONMENT
    'local'

Metadata

Release files for config-py2 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for config-py2 1.3.3
File Size Uploaded Provenance
config_py2-1.3.3.tar.gz 4.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for config-py2 1.3.3
File Interpreter ABI Platform
config_py2-1.3.3-py2-none-any.whl Python 2 none any Details

Total release size: 22.1 kB

Release files / config_py2-1.3.3.tar.gz

Download URL config_py2-1.3.3.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c795645e6ee6ecaa241cf71c158136a504343495e38c7df53efe4d2e659e0475
BLAKE2b-256 checksum
How to use checksums
73b49442e1efda3cb0d92ca0e378d232c1dcdbdccdf2280e4b40b5d4d06b3372
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/2.7.18

Release files / config_py2-1.3.3-py2-none-any.whl

Download URL config_py2-1.3.3-py2-none-any.whl
Size 17.6 kB
Tags Python 2
SHA-256 checksum
How to use checksums
c87b5c7b224790cf805679530893359e0d9761d5f660b9b2fb83d9b286c988d4
BLAKE2b-256 checksum
How to use checksums
ee4bfbdd68b3c52e24f09c3242e91c8ec1e4f12bb0453b6fe86da3f8bb5617b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/2.7.18

Security for config-py2 1.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page