Load you config with one line of code
Project description
🛠️ Cfgone
Minimal Python package that loads your config in one line of code.
📦 Installation
pip install cfgone
⚡ Quick Start
Create a config.yaml file in your current directory:
app:
name: "MyApp"
port: 8080
debug: true
database:
host: "localhost"
port: 5432
Use it in your code:
import cfgone as cfg
print(f"Starting {cfg.app.name} on port {cfg.app.port}")
# Output: Starting MyApp on port 8080
🧬 Config Inheritance
Split your config into multiple files:
base.yaml
app:
name: "BaseApp"
debug: false
database:
host: "localhost"
config.yaml
extends:
- "base.yaml"
app:
name: "MyApp" # overrides base
port: 8080 # adds new setting
database:
port: 5432 # merges with base
Access your merged config:
import cfgone as cfg
print(cfg.app.name) # "MyApp"
print(cfg.database.host) # "localhost" (from base.yaml)
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
cfgone-0.1.0.tar.gz
(9.9 kB
view details)
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 cfgone-0.1.0.tar.gz.
File metadata
- Download URL: cfgone-0.1.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f31dadf420ad06f4af7973c418329b402917d497af1393f61f2899d93a968155
|
|
| MD5 |
a60f5d2daa329a2f0eb70b0eab6f7b02
|
|
| BLAKE2b-256 |
d400d02128864fcc26873b28ccc391f2fb3aacd0673d1b9182619525082aaec2
|
File details
Details for the file cfgone-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cfgone-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d617ba5b4db8651149674ce27e84b0367feddb9412d049bdd220edc90e6a2625
|
|
| MD5 |
8e9036fe83fc0e4006423a61532b9d97
|
|
| BLAKE2b-256 |
f8d1334d2f417a3662949a703a973dc6f9159ebadae35d696b2b63d72a5c0951
|