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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file config_onion-0.0.1.tar.gz.
File metadata
- Download URL: config_onion-0.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99a59b20a92f5df99a98991195ffd487ee553c56d83f403270ebe0797c00e69f
|
|
| MD5 |
dd76b3ff494a94efb12ee6d2b80def15
|
|
| BLAKE2b-256 |
723ab1ab9c21339b377d0b423be8cca63c8be0c153c7f65b6dc8a08df86a2597
|
File details
Details for the file config_onion-0.0.1-py3-none-any.whl.
File metadata
- Download URL: config_onion-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
409a3d5685bc7eb9a48eb0c2d3fdbd5bec28cd27898ad1abec454eadefa93cfc
|
|
| MD5 |
ec11621a88eefe2693ebcd9b8142ef02
|
|
| BLAKE2b-256 |
9755293abc40e1f7ace57beee2417c7b4c6945dfb77fb93b46afc1ac523d804c
|