Metadata-Version: 2.4
Name: bean-config
Version: 0.1.0
Summary: Minimal config framework
Author-email: numen-0 <numen.0x1dea@gmail.com>
License: MIT License
        
        Copyright (c) `2026` `numen-0`
        
        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/numen-0/bean
Project-URL: repository, https://github.com/numen-0/bean
Project-URL: issues, https://github.com/numen-0/bean/issues
Keywords: bean,bean.config
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# bean.config

`bean.config` is a minimal configuration framework for Python.

Define a configuration schema as a class, then populate it from one or more
config sources with type validation and customizable source priorities.

> Just enough to arrange some beans.

---

## Overview

With `bean.config` you get:

- **Typed configuration** from a simple class definition.
- **Multiple sources** (`args`, `envs`, `overrides`, custom sources).
- **Customizable priorities** between configuration sources.
- **Debugging helpers** to inspect loaded configurations.

## Installation

Requirements:

- Python `3.14+`

Using `pip`:

```sh
pip install --upgrade bean-config
```

Using `curl` (direct download):

```sh
curl -Ls \
    https://raw.githubusercontent.com/numen-0/bean/refs/heads/main/bean-config/src/bean/config.py
```

## API

This is a quick reference for the main `API`.

For full details, see the [source code](/bean-config/src/bean/config.py).

### Config Example

```py
from enum import Enum
from bean import config

class Color(Enum):
    RED   = "#ff0000"
    GREEN = "#00ff00"
    BLUE  = "#0000ff"

@config
class MySimpleConfig:
    NAME: str
    EMAIL: str
    DEBUG: bool = False
    PORT: int = 8080
    HOST: str = "localhost"
    COLORS: list[Color] = [Color.RED]

print(config.dump_str(MySimpleConfig))
```

#### Sources

Built-in sources

| source            | description                                              |
|:-----------------:|:---------------------------------------------------------|
| `args`            | command-line arguments parsed with `argparse`.           |
| `envs`            | environment variables.                                   |
| `defaults`        | default values defined on the configuration class.       |
| `overrides`       | values supplied via the `overrides` parameter.           |

## License

All the repo falls under the [MIT License](/LICENSE).

