All Projects → hynek → Environ Config

hynek / Environ Config

Licence: apache-2.0
Python Application Configuration With Environment Variables

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Environ Config

Env
Simple lib to parse environment variables to structs
Stars: ✭ 2,164 (+930.48%)
Mutual labels:  environment-variables, config, environment, configuration
dotfiles
My personal app/env configs and dotfiles.
Stars: ✭ 27 (-87.14%)
Mutual labels:  config, environment, configuration
Fig
A minimalist Go configuration library
Stars: ✭ 142 (-32.38%)
Mutual labels:  environment, environment-variables, configuration
env
A lightweight package for loading OS environment variables into structs for Go projects
Stars: ✭ 24 (-88.57%)
Mutual labels:  config, configuration, environment-variables
salak.rs
A multi layered configuration loader and zero-boilerplate configuration parser.
Stars: ✭ 27 (-87.14%)
Mutual labels:  config, environment, configuration
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (-59.05%)
Mutual labels:  config, configuration, environment-variables
Phpdotenv
Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
Stars: ✭ 11,648 (+5446.67%)
Mutual labels:  environment, configuration, environment-variables
dart environment config
Environment specific config generator for Dart and Flutter applications during CI/CD builds
Stars: ✭ 87 (-58.57%)
Mutual labels:  environment, configuration, environment-variables
Conf
Go package for loading program configuration from multiple sources.
Stars: ✭ 70 (-66.67%)
Mutual labels:  environment, environment-variables, configuration
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+891.43%)
Mutual labels:  config, environment-variables, configuration
Node Convict
Featureful configuration management library for Node.js
Stars: ✭ 1,855 (+783.33%)
Mutual labels:  config, environment-variables, configuration
Aconfig
Simple, useful and opinionated config loader.
Stars: ✭ 187 (-10.95%)
Mutual labels:  config, environment-variables, configuration
climatecontrol
Python library for loading settings and config data from files and environment variables
Stars: ✭ 20 (-90.48%)
Mutual labels:  config, configuration, environment-variables
ngx-env
Easily inject environment variables into your Angular applications
Stars: ✭ 73 (-65.24%)
Mutual labels:  environment, configuration, environment-variables
cfg-rs
A Configuration Library for Rust Applications
Stars: ✭ 18 (-91.43%)
Mutual labels:  config, environment, configuration
goodconf
Transparently load variables from environment or JSON/YAML file.
Stars: ✭ 80 (-61.9%)
Mutual labels:  config, configuration, environment-variables
read-env
🔧 Transform environment variables into JSON object with sanitized values.
Stars: ✭ 60 (-71.43%)
Mutual labels:  config, configuration, environment-variables
superconfig
Access environment variables. Also includes presence validation, type coercion and default values.
Stars: ✭ 33 (-84.29%)
Mutual labels:  config, configuration, environment-variables
environment
🌳 Environment variable configuration for Node.js made easy.
Stars: ✭ 12 (-94.29%)
Mutual labels:  config, environment, configuration
Config
A lightweight yet powerful config package for Go projects
Stars: ✭ 126 (-40%)
Mutual labels:  config, environment-variables, configuration

============================================================== environ-config: Application Configuration With Env Variables

.. image:: https://readthedocs.org/projects/environ-config/badge/?version=stable :target: https://environ-config.readthedocs.io/ :alt: Documentation Status

.. image:: https://github.com/hynek/environ-config/workflows/CI/badge.svg?branch=master :target: https://github.com/hynek/environ-config/actions?workflow=CI :alt: CI Status

.. image:: https://codecov.io/gh/hynek/environ-config/branch/master/graph/badge.svg :target: https://codecov.io/gh/hynek/environ-config :alt: Test Coverage

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black :alt: Code style: black

.. -teaser-begin-

environ-config allows you to configure your applications using environment variables – as recommended in The Twelve-Factor App <https://12factor.net/config>_ methodology – with elegant, boilerplate-free, and declarative code:

.. code-block:: pycon

import environ

Extracts secrets from Vault-via-envconsul: 'secret/your-app':

vault = environ.secrets.VaultEnvSecrets(vault_prefix="SECRET_YOUR_APP") @environ.config(prefix="APP") ... class AppConfig: ... @environ.config ... class DB: ... name = environ.var("default_db") ... host = environ.var("default.host") ... port = environ.var(5432, converter=int) # Use attrs's converters and validators! ... user = environ.var("default_user") ... password = vault.secret() ... ... env = environ.var() ... lang = environ.var(name="LANG") # It's possible to overwrite the names of variables. ... db = environ.group(DB) ... awesome = environ.bool_var() cfg = environ.to_config( ... AppConfig, ... environ={ ... "APP_ENV": "dev", ... "APP_DB_HOST": "localhost", ... "LANG": "C", ... "APP_AWESOME": "yes", # true and 1 work too, everything else is False ... # Vault-via-envconsul-style var name: ... "SECRET_YOUR_APP_DB_PASSWORD": "s3kr3t", ... }) # Uses os.environ by default. cfg AppConfig(env='dev', lang='C', db=AppConfig.DB(name='default_db', host='localhost', port=5432, user='default_user', password=), awesome=True) cfg.db.password 's3kr3t'

AppConfig.from_environ({...}) is equivalent to the code above, depending on your taste.

Features

  • Declarative & boilerplate-free.

  • Nested configuration from flat environment variable names.

  • Default & mandatory values: enforce configuration structure without writing a line of code.

  • Built on top of attrs <https://www.attrs.org/>_ which gives you data validation and conversion for free.

  • Pluggable secrets extraction. Ships with:

    • HashiCorp Vault <https://www.vaultproject.io>_ support via envconsul <https://github.com/hashicorp/envconsul>_.
    • INI files, because secrets in env variables are icky.
  • Helpful debug logging that will tell you which variables are present and what environ-config is looking for.

  • Built-in dynamic help documentation generation.

.. -teaser-end-

You can find the full documentation including a step-by-step tutorial on Read the Docs <https://environ-config.readthedocs.io/>_.

Project Information

environ-config is released under the Apache License 2.0 <https://choosealicense.com/licenses/apache-2.0/>_ license. It targets Python 2.7, 3.5 and newer, and PyPy. Development takes place on GitHub <https://github.com/hynek/environ-config>_.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].