Skip to main content

Powerful helper utility to create shell alias commands to easily set collections of environment variables often with secret values from a variety of data-sources and data-formats.

Project description

Env Alias

PyPi Python Versions Build Status Read the Docs License

Powerful helper utility to create shell alias commands to easily set collections of environment variables often with secret values from a variety of data-sources and data-formats.

Enables complex environment setups to be stored in source-control without secret values which makes it particularly useful in loading secret values into containerized service environments and developer environments alike.

Features

  • Data sources: local-file, http-remote, exec-stdout or directly-set
  • Source file formats: text, ini, json, yaml
  • Select using jq-style selectors, xpath selectors or line-numbers
  • Reference other env values within configuration
  • Content-Type detection for http-remote data-sources to automatically assign appropriate parser
  • Run exec helper commands without content assignment for creating setups
  • Debug mode output to STDERR

Installation

user@computer:~$ pip3 install env-alias

Command Line Usage

This tool is typically invoked via an entry in .bash_aliases with an entry in the form:-

eval $(env-alias env-project-awesome ~/path-to/project-awesome-alias.yml)

This simple one-liner creates a command alias in the name env-project-awesome that subsequently invokes an alias-generator that gives effect to the .yml configurations(s).

By naming your alias commands with a common prefix such as env- it also becomes possible to leverage shell tab-completion to quickly find aliases that implement the environment settings for your project, use-case or other situation.

This mechanism is enormously useful in working with large sets of environment variables from encrypted or otherwise secured data-sources which means an environment configuration can be easily committed to source control without the secret values.

Be sure to review the examples that make the benefits of this arrangement clear.

Project


Copyright © 2020 Nicholas de Jong

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

env-alias-0.3.5.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

env_alias-0.3.5-py3-none-any.whl (21.8 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