Skip to main content

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


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)

Uploaded Source

Built Distribution

config_onion-0.0.1-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page