Metadata-Version: 2.1
Name: bc-configs
Version: 0.1.2
Summary: Configuration module, that provides a way to manage configs structure, validation and casting to type inside your code. Based on pedantic models. Additionally it can automatically getting config from environment variables, .env, HashiCorp Vault, etc.
Home-page: https://github.com/etagi-esoft/py-bc-configs
License: MIT
Keywords: config,environment,dotenv,pydantic
Author: Artem Shirokikh
Author-email: job@artemetr.ru
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pydantic (>=2.3.0,<3.0.0)
Project-URL: Repository, https://github.com/etagi-esoft/py-bc-configs
Description-Content-Type: text/markdown

# bc-config

![](./docs/source/_static/coverage-badge.svg) ![](./docs/source/_static/unittests-badge.svg) ![](./docs/source/_static/mypy-badge.svg) ![](./docs/source/_static/ruff-badge.svg)

*Make configuring your application easier.*

# Installing

```bash
pip install bc-configs
```

# Make your custom config class

```python
import os
from bc_configs import BaseConfig

class MyConfig(BaseConfig):
    some_int: int
    some_string: str
    some_bool: bool

my_config = MyConfig()  # type: ignore[call-arg]

assert int(os.getenv("MY_SOME_INT")) == my_config.some_int  # True
assert os.getenv("MY_SOME_STRING") == my_config.some_string  # True
assert bool(os.getenv("MY_SOME_BOOL")) == my_config.some_bool  # True
```

The name of the environment variable is formed based on the names of the class and field.

