Skip to main content

An easy way to manage environment specific configuration

Project description

Yamz

An easy way to manage environment specific configuration in Python using PyYAML.

Requirements

  • Python >=3.5
  • PyYAML >=5.1

Why Yamz?

All the other names I managed to think of were already taken, so... here we are.

How to use

  • pip install yamz
  • Configure your environment in settings.yaml
    • I recommend using environments names such as: production, development, etc., Note: global environment settings will be available in all environments
    • If you would like to include variables from your environment, make sure to add a $ prefix ($HOME) and Yamz will make sure it's included.
    global:
      TEST: some_test
    production:
      HOME: $HOME
      MYSQL_DB_HOST: 1.2.3.4
      MYSQL_DB_PASS: $MYSQL_DB_PASS
    
import os

from yamz import Yamz


base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
path = os.path.join(base, 'settings.yaml')

env = Yamz(path)
prod_env = env.load("production")

prod_env.MYSQL_DB_HOST

Contributions

If you'd like to contribute and make Yamz better, feel free to open up a PR. I'll review it at my earliest convenience!

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

yamz-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yamz-0.1.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file yamz-0.1.1.tar.gz.

File metadata

  • Download URL: yamz-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for yamz-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c1cda8ebed88ebbda7cc8133be1dcb4e943d8a1387340c12a5317cd3ae995ccc
MD5 a1689d17fa4e5966e14ac40b56f63a2e
BLAKE2b-256 b626226e712389e8a4df972656adcef8229c366722f4b0650ca4585ea04fa8e8

See more details on using hashes here.

File details

Details for the file yamz-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yamz-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for yamz-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a993023282f177fdebc8d5dabd3cc444f4adb5863419501ec075a3ad0422f3bc
MD5 b498c316de89affc3977a0359e8ab71a
BLAKE2b-256 b47f71fb894b234a4c63005e463eff4a4d8d204d9942d620eb165e3b262399cc

See more details on using hashes here.

Supported by

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