A python package for reading configurations from different sources
Reason this release was yanked:
Missed push, released from old code
Project description
bubbleconf
A tiny, battery-included configuration helper for Python projects. Use a dataclass to declare your configuration, then populate it from command-line arguments, environment variables, and sensible defaults with predictable priority.
Installation
pip install bubbleconf
Or, for development from this repository:
# from the repo root
python -m pip install --upgrade pip
python -m pip install --upgrade uv
uv sync
Short example
@dataclass
class MyConfig:
version: str
is_cool: bool = False
number_of_things: int = 0
ratio: float = 1.0
cfg = parse_config(MyConfig)
print(cfg)
You can set values by environment variables (VERSION, IS_COOL, ...), by CLI flags, or by defaults in the dataclass. The parser chooses values in a predictable priority order:
$ VERSION="0.1.2" uv run test.py --is_cool=true
MyConfig(version='0.1.2', is_cool=True, number_of_things=0, ratio=1.0)
CLI example
Advanced usage
- Boolean flags accept
0/1,true/false, and common truthy/falsy strings. - Unknown or invalid values raise a
ConfigErrorwith an easy-to-read message (TTY-aware when printed in terminals).
Contributing
PRs are welcome. The project uses uv to manage the local environment. Run tests with:
uv run pytest -q
If you change packaging metadata, the CI workflow .github/workflows/publish.yml will build and either publish a dev build to TestPyPI or (for tagged commits) publish to PyPI.
License
This project is MIT-licensed. See the LICENSE file for details.
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
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 bubbleconf-0.3.0.tar.gz.
File metadata
- Download URL: bubbleconf-0.3.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
905eae9b2333d756688c73b9991a3fe882947993f953e50076bfa14c3e2074ef
|
|
| MD5 |
6d25354a0642716fc2f6ee0f7c0c441b
|
|
| BLAKE2b-256 |
5fa35c38d9d19738d2d0ad6a0881f4bcd47d7da755854f2ba1321ff3e841f14e
|
Provenance
The following attestation bundles were made for bubbleconf-0.3.0.tar.gz:
Publisher:
publish.yml on bubbleconf/bubbleconf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bubbleconf-0.3.0.tar.gz -
Subject digest:
905eae9b2333d756688c73b9991a3fe882947993f953e50076bfa14c3e2074ef - Sigstore transparency entry: 1392687736
- Sigstore integration time:
-
Permalink:
bubbleconf/bubbleconf@7da1e7487015e6179bc1318e6c3b1023f49d1a6f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/bubbleconf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7da1e7487015e6179bc1318e6c3b1023f49d1a6f -
Trigger Event:
push
-
Statement type:
File details
Details for the file bubbleconf-0.3.0-py3-none-any.whl.
File metadata
- Download URL: bubbleconf-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb5a5e231cc6daa8f9974b8b7c3ad9ef4b93792203fac909df3fcfe7b170d6a9
|
|
| MD5 |
688a19bc8e309441187dfd6a888bdfba
|
|
| BLAKE2b-256 |
4eb4ce9f5c64680a55d1f4aa2ff1cc88e8a1bc9d2a81958ee9f1adfa3e580c9d
|
Provenance
The following attestation bundles were made for bubbleconf-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on bubbleconf/bubbleconf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bubbleconf-0.3.0-py3-none-any.whl -
Subject digest:
bb5a5e231cc6daa8f9974b8b7c3ad9ef4b93792203fac909df3fcfe7b170d6a9 - Sigstore transparency entry: 1392687742
- Sigstore integration time:
-
Permalink:
bubbleconf/bubbleconf@7da1e7487015e6179bc1318e6c3b1023f49d1a6f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/bubbleconf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7da1e7487015e6179bc1318e6c3b1023f49d1a6f -
Trigger Event:
push
-
Statement type: