alchemy-config-1.0.0
توضیحات
Configuration framework in Python for general configuration use.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | alchemy-config-1.0.0 |
| نام | alchemy-config |
| نسخه کتابخانه | 1.0.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Gabe Goodhart |
| ایمیل نویسنده | gabe.l.hart@gmail.com |
| آدرس صفحه اصلی | https://github.com/IBM/alchemy-config |
| آدرس اینترنتی | https://pypi.org/project/alchemy-config/ |
| مجوز | MIT |
# Alchemy Config
The `aconfig` library provides simple `yaml` configuration in `python` with environment-based overrides.
## Installation
To install, simply use `pip`
```sh
pip install alchemy-config
```
## Quick Start
**config.yaml**
```yaml
foo: 1
bar:
baz: "bat"
```
**main.py**
```py
import aconfig
if __name__ == "__main__":
config = aconfig.Config.from_yaml("config.yaml")
print(config.foo)
print(config.bar.baz)
```
```sh
export BAR_BAZ="buz"
python3 main.py
```
## Corner-case Behavior
You CAN set builtin method names as attributes on the `config`. However, you should only access/delete them via dictionary access methods.
For example:
```py
import aconfig
cfg = {"update": True}
config = aconfig.Config(cfg)
# DO NOT DO THIS:
config.update
# DO THIS INSTEAD:
config["update"]
```
This is because there is no way in Python to tell whether you want the method or the attribute `"update"` when "getting" it from the object.
نیازمندی
| مقدار | نام |
|---|---|
| >=5.3.1 | PyYAML |
نحوه نصب
نصب پکیج whl alchemy-config-1.0.0:
pip install alchemy-config-1.0.0.whl
نصب پکیج tar.gz alchemy-config-1.0.0:
pip install alchemy-config-1.0.0.tar.gz