bc-configs


Namebc-configs JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://github.com/etagi-esoft/py-bc-configs
SummaryConfiguration 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.
upload_time2023-12-14 11:32:10
maintainer
docs_urlNone
authorArtem Shirokikh
requires_python>=3.11,<4
licenseMIT
keywords config environment dotenv pydantic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/etagi-esoft/py-bc-configs",
    "name": "bc-configs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4",
    "maintainer_email": "",
    "keywords": "config,environment,dotenv,pydantic",
    "author": "Artem Shirokikh",
    "author_email": "job@artemetr.ru",
    "download_url": "https://files.pythonhosted.org/packages/a9/02/a1ebe7c4e3c6031c6a038f21703cfce85bec84705302d93d8fc310d57d75/bc_configs-0.1.7.tar.gz",
    "platform": null,
    "description": "# bc-config\n\n![](./docs/source/_static/coverage-badge.svg) ![](./docs/source/_static/unittests-badge.svg) ![](./docs/source/_static/mypy-badge.svg) ![](./docs/source/_static/ruff-badge.svg)\n\n*Make configuring your application easier.*\n\n# Installing\n\n```bash\npip install bc-configs\n```\n\n# Make your custom config class\n\n```python\nimport os\nfrom bc_configs import BaseConfig\n\nclass MyConfig(BaseConfig):\n    some_int: int\n    some_string: str\n    some_bool: bool\n\nmy_config = MyConfig()  # type: ignore[call-arg]\n\nassert int(os.getenv(\"MY_SOME_INT\")) == my_config.some_int  # True\nassert os.getenv(\"MY_SOME_STRING\") == my_config.some_string  # True\nassert bool(os.getenv(\"MY_SOME_BOOL\")) == my_config.some_bool  # True\n```\n\nThe name of the environment variable is formed based on the names of the class and field.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "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.",
    "version": "0.1.7",
    "project_urls": {
        "Homepage": "https://github.com/etagi-esoft/py-bc-configs",
        "Repository": "https://github.com/etagi-esoft/py-bc-configs"
    },
    "split_keywords": [
        "config",
        "environment",
        "dotenv",
        "pydantic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5547ef0618d5afb2a68f4371c14ecde0d90dfdfa2907c642374ebbcd771434a0",
                "md5": "ad2d8d8764954cab657ca8d630a6dbcf",
                "sha256": "ae9d0a6ad57ddff7eaec53f2058ad61c543102ae65b8b7f6e12a3b3020136210"
            },
            "downloads": -1,
            "filename": "bc_configs-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ad2d8d8764954cab657ca8d630a6dbcf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4",
            "size": 7975,
            "upload_time": "2023-12-14T11:32:08",
            "upload_time_iso_8601": "2023-12-14T11:32:08.636623Z",
            "url": "https://files.pythonhosted.org/packages/55/47/ef0618d5afb2a68f4371c14ecde0d90dfdfa2907c642374ebbcd771434a0/bc_configs-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a902a1ebe7c4e3c6031c6a038f21703cfce85bec84705302d93d8fc310d57d75",
                "md5": "14871ce2b04c81d8b2a30c5c95e72875",
                "sha256": "f361244d85e271b2fdf1433ffd6aef900bb9e4016b61ce4c97a40c4a2cb0bada"
            },
            "downloads": -1,
            "filename": "bc_configs-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "14871ce2b04c81d8b2a30c5c95e72875",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4",
            "size": 6763,
            "upload_time": "2023-12-14T11:32:10",
            "upload_time_iso_8601": "2023-12-14T11:32:10.539476Z",
            "url": "https://files.pythonhosted.org/packages/a9/02/a1ebe7c4e3c6031c6a038f21703cfce85bec84705302d93d8fc310d57d75/bc_configs-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-14 11:32:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "etagi-esoft",
    "github_project": "py-bc-configs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bc-configs"
}
        
Elapsed time: 0.16679s