Library for one endpoint config managment
Project description
Sitri - powerful settings & configs for python
Sitri - library for managing authorization and configuration data from a single object with possibly different or identical providers
Installation
poetry add sitri -E "all"
or
pip3 install sitri[all]
Extras packs and providers:
1. all - all providers and settings module.
2. settings - pydantic, providers with settings-support.
3. redis - for redis provider.
4. hvac - for HashiCorp Vault provider.
5. vedis - for vedis provider.
6. pyyaml - for YAML provider.
7. structlog - structlog package if your app does not provide structlog (optional, default logging package also support).
8. ujson - speed-up your json provider (optional).
Basics with SystemProvider
from sitri.providers.contrib import SystemConfigProvider
from sitri import Sitri
conf = Sitri(
config_provider=SystemConfigProvider(prefix="basics"),
)
System provider use system environment for get config 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/
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
sitri-1.0.0.tar.gz
(11.7 kB
view hashes)
Built Distribution
sitri-1.0.0-py3-none-any.whl
(18.0 kB
view hashes)