Metadata-Version: 2.4
Name: bubbleconf
Version: 0.2.2
Summary: A python package for reading configurations from different sources
Author-email: Felix Bjært Hargreaves <not-a-real@email.com>
License: MIT License
        
        Copyright (c) 2025 Your Name
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/bubbleconf/
Project-URL: Repository, https://github.com/bubbleconf/bubbleconf
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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.
<p align="center">

![](https://raw.githubusercontent.com/bubbleconf/bubbleconf/main/logo.svg)

</p>

## Installation

```bash
pip install bubbleconf
```

Or, for development from this repository:

```bash
# from the repo root
python -m pip install --upgrade pip
python -m pip install --upgrade uv
uv sync
```

## Short example

```python
@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:

```console
$ 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

![](https://raw.githubusercontent.com/bubbleconf/bubbleconf/main/image-2.png)

## Advanced usage

- Boolean flags accept `0/1`, `true/false`, and common truthy/falsy strings.
- Unknown or invalid values raise a `ConfigError` with 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:

```bash
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.
