bc-configs 0.1.7

Last updated:

0 purchases

bc-configs 0.1.7 Image
bc-configs 0.1.7 Images
Add to Cart

Description:

bcconfigs 0.1.7

bc-config

Make configuring your application easier.
Installing
pip install bc-configs

Make your custom config class
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.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.