Package to manage configuration for you project.
Project description
Polidoro Config
Polidoro Config it is a configuration manager for you project
| Python Versions |
|---|
Basic Usage
Create a class inheriting from ConfigBase
from pconfig import ConfigBase
class Config(ConfigBase):
DB_HOST = 'localhost'
ENVIRONMENT = 'development'
...
When the class is instantiated will load from environment variables.
# script.py
from pconfig import ConfigBase
class Config(ConfigBase):
MY_VAR = 'default_value'
print(Config.MY_VAR)
>>> python script.py
default_value
>>> MY_VAR="new_value" python script.py
new_value
If you have the python-dotenv installed will load the .env automatically.
Also, you can load from a .yaml file setting the file path in the Config class:
# script.py
from pconfig import ConfigBase
class Config(ConfigBase):
file_path = "my_config.yml"
MY_VAR = 'default_value'
For more information see the Documentation
Project details
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 polidoro_config-1.0.1.tar.gz.
File metadata
- Download URL: polidoro_config-1.0.1.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0f4bdaa289128efc7a30279abf0d9aa43fbbfc68aa00a6493152dd2d3b5cfc6
|
|
| MD5 |
68126b7dad3988e5f624a3cb7e2a2fbb
|
|
| BLAKE2b-256 |
5fb39d6b0d548a224dce73029124e0b5fa99c9a99529d78b8df7bee250f030ba
|
File details
Details for the file polidoro_config-1.0.1-py3-none-any.whl.
File metadata
- Download URL: polidoro_config-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12e25e836f9e6a50a950fface9b24f91fcca3b9f423c42680a96c661eb7207e4
|
|
| MD5 |
3d39e8b6f5ff2f722f151b8e86e9b95d
|
|
| BLAKE2b-256 |
1663ee7e1796c635241be87e57384cc3c6f3f9fa976de298d19a2d1274bf37f2
|