Skip to main content

Load YAML configs with environment variables interpolation

Project description

Build Code Climate maintainability Code Climate coverage Black Formatter PyPI - Python Version MIT License

Piny

YAML configs loader with environment variables interpolation for Python.

Keep your app’s configuration in YAML file with sensitive data marked as environment variables. Put sensitive data into environment variables. Then let piny interpolate the variables on YAML loading.

Piny is a recursive acronym for Piny Is Not YAML

Installation

Install using pip install -U piny.

Usage

Set your environment variables, add them to your YAML configuration file:

db:
  login: user
  password: ${DB_PASSWORD}
mail:
  login: user
  password: ${MAIL_PASSWORD:-my_default_password}

Then load your config:

from piny import YamlLoader

config = YamlLoader(path="config.yaml").load()
print(config)
# {'db': {'login': 'user', 'password': 'my_db_password'},
# 'mail': {'login': 'user', 'password': 'my_default_password'}}

CHANGELOG

v0.1.1 (2019-06-7)

  • CI/CD config minor tweaks

  • README updated

v0.1.0 (2019-06-7)

  • YamlLoader added

  • Makefile added

  • CI/CD minimal pipeline added

v0.0.1 (2019-06-7)

  • Start the project

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

piny-0.1.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

piny-0.1.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