gitter-badger / sitri

Sitri - library for managing authorization and configuration data from a single object with possibly different or identical providers

Home Page:https://sitri.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sitri Configuration Library

Build Status codecov PyPI Read the Docs CodeFactor

Sitri - library for managing authorization and configuration data from a single object with possibly different or identical providers

Installation

poetry add sitri

or

pip3 install sitri

Basics with SystemProvider

from sitri.contrib.system import SystemCredentialProvider, SystemConfigProvider
from sitri import Sitri

conf = Sitri(config_provider=SystemConfigProvider(prefix="basics"),
             credential_provider=SystemCredentialProvider(prefix="basics"))

System provider use system environment for get config and credential data. For unique sitri lookup to "namespace" by prefix.

Example:

In console:

export BASICS_NAME=Huey

In code:

name = conf.get_config("name")
print(name)  # output: Huey

Docs

Read base API references and other part documentation on https://sitri.readthedocs.io/

About

Sitri - library for managing authorization and configuration data from a single object with possibly different or identical providers

https://sitri.readthedocs.io/en/latest/

License:MIT License


Languages

Language:Python 100.0%