config_onion - layered configuration, because configs are like ogres
Project description
NAME
config_onion - layered configuration, because configs are like ogres
VERSION
0.0.1
DESCRIPTION
@@ 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
Склеивает конфиги. Так же разыменовывает ссылки вида:
$ref: ...
$path: ...
Такая система используется в swagger-е. В perl есть аналогичный модуль Config::Onion
.
FUNCTIONS
read
ARGUMENTS
configs
- список файловых путей к конфигам. Обязательный
RETURNS
Any
INSTALL
$ 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
config_onion-0.0.1.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for config_onion-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 409a3d5685bc7eb9a48eb0c2d3fdbd5bec28cd27898ad1abec454eadefa93cfc |
|
MD5 | ec11621a88eefe2693ebcd9b8142ef02 |
|
BLAKE2b-256 | 9755293abc40e1f7ace57beee2417c7b4c6945dfb77fb93b46afc1ac523d804c |