Skip to main content

ccaConfig

a config file utility. Will read yaml formatted config files from various locations in the following order, so that the 'nearer' files override the further ones. Finally, it checks the environment for variables and overrides any set in the config file.

The order of files to read is

/etc/appname.yaml
/etc/appname/appname.yaml
$HOME/.config/appname.yaml
$HOME/Library/Preferences/appname.yaml
$HOME/.appname.yaml
$(pwd)/appname.yaml

Any environment variables of the form

APPNAME_VARIABLENAME

will be found, chopped at the underscore, lower cased and set into the final configuration i.e: config[variablename] will exist if there is an environment variable APPNAME_VARIABLENAME.

Usage

from ccaconfig.config import ccaConfig

cf = ccaConfig(appname="appname")
config = cf.envOverride()

or, to not take environment variables into account:

from ccaconfig.config import ccaConfig

cf = ccaConfig(appname="appname")
config = cf.findConfig()

Two additional dictionaries can be supplied, the first defaultd can be used to set a default config, and the 2nd, overrided can be used for config variables that you do not want overridden by any config file found or from the environment.

from ccaconfig.config import ccaConfig

defd = {"environment": "dev"}
overd = {"product": "myapp"}
cf = ccaConfig(appname="appname", defaultd=defd, overrided=overd)
config = cf.envOverride()
# config["environment"] == "dev" if it is not overridden by a subsequent
# config file or from an environment variable
#
# config["product"] == "myapp" and will not be overridden, at all

Metadata

Release files for ccaconfig 0.4.0

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

Source distribution (sdist)

Source distribution for ccaconfig 0.4.0
File Size Uploaded Provenance
ccaconfig-0.4.0.tar.gz 2.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ccaconfig 0.4.0
File Interpreter ABI Platform
ccaconfig-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.2 kB

Release files / ccaconfig-0.4.0.tar.gz

Download URL ccaconfig-0.4.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
277e4c1cd8750c7192cc1a283455871ed24b78e4bed04331b5b74299e8059dbd
BLAKE2b-256 checksum
How to use checksums
2cd5de3151b2817c78e01ef5a6c944c703b3ce71b770af22505cbf44e8d0d269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.8 Linux/6.6.19-1-MANJARO

Release files / ccaconfig-0.4.0-py3-none-any.whl

Download URL ccaconfig-0.4.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b01c7b1e49943aa98391941bee21844b662e62551c437f79ecb029132d755415
BLAKE2b-256 checksum
How to use checksums
d87f416e76b89e89040b5da8a01690829fe5ab292762bcd5083fd91ce64d8ef0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.8 Linux/6.6.19-1-MANJARO

Security for ccaconfig 0.4.0

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