A basic config package that reads a JSON config file, environment variables, and console arguments (prioritized in that order)
Project description
PrefRef
Config init in __main__
Subsection
example code
Boolean Arguments
There are two types of boolean arguments supported as a Config_Option, the property 'is_flag' will determine how the boolean is handled.
If 'is_flag' is true, the option can only be set by environment variable or console argument and cannot be stored in a config file. Passing the argument or having the environment variable existing, with or without explicitly setting it to a true/false value, will set the Config_Option value to True. Otherwise, the value will be set to the default value of the Config_Option.
If 'is_flag' is false, the option can also be stored in a config file. You can either pass the console argument or have the environment variable set without an explicit statement of true/false to set it to True OR set it explicitly by passing/setting the value to true or false.
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
File details
Details for the file prefref-24.2.700.tar.gz
.
File metadata
- Download URL: prefref-24.2.700.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 272fd04ebdcb98b3018dd0be0fe843254648dc6df7be1052ea483c3d05ffaa95 |
|
MD5 | d9fe2c34aa8d22c102d812d21182e978 |
|
BLAKE2b-256 | 11b57845f0389a690324b927f014b2578058f9f82e5d517859d8bae2a8635b7f |
File details
Details for the file prefref-24.2.700-py3-none-any.whl
.
File metadata
- Download URL: prefref-24.2.700-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2c18103da8842c6b06063b052734b048082d9896f3cfa17e80e88e346af3db3 |
|
MD5 | 70692620b6a4e52f6148931d73dfd5ee |
|
BLAKE2b-256 | 096a44fd4dd180c463f3f2947b07b78a5ead7bdbfaafa194698caaa8d8630bac |