Skip to main content

ConfigEnv Build Status Coverage Status PyPI version PyPI - Python Version

Gestionnaire de configuration en json, ini avec overide possible en variable d’environnement

install

with pip :

pip install ConfigEnv

how to use

You can actualy use ConfigEnv with either: - json file - ini file - environement variable

Notice than the environement variable will take over configuration files

basic json exemple:

with the file :

// config.json
{
    "AWS" : {
        "ACCESS_KEY_ID" : "toto"
    }
}
from ConfigEnv import Config

config = Config("config.json")
print(config.get("AWS_ACCESS_KEY_ID"))
# prints toto

overide file

you can add more file to veride configs notice that the lib works with cache, so register all your config files before request config

// config.json
{
    "AWS" : {
        "ACCESS_KEY_ID" : "toto"
    }
}
; config.ini
[AWS]
ACCESS_KEY_ID=tata
from ConfigEnv import Config

config = Config("config.json")
config.addFile = Config("config.ini")
print(config.get("AWS_ACCESS_KEY_ID"))
# prints tata

overide with environement variable

// config.json
{
    "AWS" : {
        "ACCESS_KEY_ID" : "toto"
    }
}

with the environement variable : AWS_ACCESS_KEY_ID=tata

from ConfigEnv import Config

config = Config("config.json")

print(config.get("AWS_ACCESS_KEY_ID"))
# prints tata

devlopping guide

we advise you to fork the depot, and if you have goot feature, we would appreciate pull request

install developement environement

with virtualenv :

virtualenv -p python3 .venv
source .venv/bin/activate

install depenencies :

pip install -r requirements.txt

test

run tests :

python -m unittest tests

coverage

run coverage

coverage run --source=ConfigEnv -m unittest tests

report coverage

coverage report -m

release

create package : python3 setup.py sdist bdist_wheel

publish : python -m twine upload dist/*

Metadata

Release files for ConfigEnv 1.2.4

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

Source distribution (sdist)

Source distribution for ConfigEnv 1.2.4
File Size Uploaded Provenance Actions
ConfigEnv-1.2.4.tar.gz 3.2 kB Without provenance Details for ConfigEnv-1.2.4.tar.gz

Release files / ConfigEnv-1.2.4.tar.gz

Download URL ConfigEnv-1.2.4.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
15aa41fbf227f7b0e4a5b51b06b606f1955015678cb58040998af7a840898567
BLAKE2b-256 checksum
How to use checksums
589bcd7411d1bf31941fce1cf67a0d714b6a2b4a7fbe4063125d9fed6661972f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.4.2 requests/2.20.0 setuptools/47.3.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.6

Security for ConfigEnv 1.2.4

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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