config-onion

config_onion - layered configuration, because configs are like ogres


License
MIT
Install
pip install config-onion==0.0.1

Documentation

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