config-onion-0.0.1
توضیحات
config_onion - layered configuration, because configs are like ogres
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | config-onion-0.0.1 |
| نام | config-onion |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Kosmina O. Yaroslav |
| ایمیل نویسنده | darviarush@mail.ru |
| آدرس صفحه اصلی | https://github.com/darviarush/python-config-onion |
| آدرس اینترنتی | https://pypi.org/project/config-onion/ |
| مجوز | MIT |
# NAME
config_onion - layered configuration, because configs are like ogres
# VERSION
0.0.1
# DESCRIPTION
```py
@@ config.yml
config:
value:
connections:
rabbitmq:
default:
- rabbitmq
- user: guest
password: guest
events:
- amounts:
connection:
$ref: config
$path: /connections/rabbitmq/default
@@ .config.yml
config:
value:
connections:
rabbitmq:
default:
- rabbitmq1
- user: root
password: 123
@@ my.py
from config_onion import read
config = read(['config.yml', '.config.yml'])
print(config_onion) # -> { ... 'connection': ['rabbitmq1', {'user': 'root', 'password: 123'}] ... }
```
# SYNOPSIS
Склеивает конфиги. Так же разыменовывает ссылки вида:
```yml
$ref: ...
$path: ...
```
Такая система используется в swagger-е. В perl есть аналогичный модуль `Config::Onion`.
# FUNCTIONS
## read
### ARGUMENTS
* `configs` - список файловых путей к конфигам. Обязательный
### RETURNS
Any
# INSTALL
```sh
$ pip install config_onion
```
# REQUIREMENTS
Нет
# LICENSE
Copyright (C) Kosmina O. Yaroslav.
This library is free software; you can redistribute it and/or modify
it under the same terms as Python itself.
# AUTHOR
Kosmina O. Yaroslav <darviarush@mail.ru>
# LICENSE
MIT License
Copyright (c) 2020 Kosmina O. Yaroslav
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl config-onion-0.0.1:
pip install config-onion-0.0.1.whl
نصب پکیج tar.gz config-onion-0.0.1:
pip install config-onion-0.0.1.tar.gz