Priority-based config loader for qdata ecosystem — hunts config.yaml/.env from home dir upward through parent dirs
Project description
qcload
Priority-based config loader for qdata ecosystem.
Quick start
from qcload import config, load_config, load_from_path
# Auto-search (global singleton, lazy load)
db_url = config["DATABASE_URL"]
# Functional call (new instance each time)
cfg = load_config()
# Load from specific file path
cfg = load_from_path("/path/to/my/config.yaml")
# Reload the global singleton
config = reload_config()
Search priority
qcload searches for config files in this order (first found wins):
~/config.yaml(user home)~/.env./config.yaml(current directory)./.env../config.yaml(parent)../.env../../config.yaml(grandparent)../../.env
Config object
cfg = load_config()
# Dict access
cfg["DATABASE_URL"]
# Attribute access (nested yaml)
cfg.database.host
# Type helpers
cfg.get_int("PORT", 8080)
cfg.get_bool("DEBUG", False)
cfg.get_float("RATE", 0.0)
cfg.get_list("HOSTS", [])
# Metadata
cfg.source # Path to the loaded file
cfg.file_type # "yaml" or "env"
cfg.is_empty # True if no keys loaded
License
MIT
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
qcload-0.1.0.tar.gz
(8.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 qcload-0.1.0.tar.gz.
File metadata
- Download URL: qcload-0.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56a248f465821d4740e5b995cef9ba7c0f71f75a725b3a57969e599214c2d7a3
|
|
| MD5 |
e588feaf59932eca69ffaae01bc97467
|
|
| BLAKE2b-256 |
b9312ad77d0319031346a26427e93f7a9f246077596dddeb937970ec4fa0a42b
|
File details
Details for the file qcload-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qcload-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
005cc0f0513903e91e2d3382865f8611afaee7dadcfefd97b4426ae2e74d7acd
|
|
| MD5 |
ead2842ede8c52a2e2ba923deaab5ee9
|
|
| BLAKE2b-256 |
5333873751e9964fd7a270fa275fb03b9d12797ef5842c39757108c265281b87
|