Skip to main content

Stacked environment variable management system.

Project description

envstack

Stacked environment variable management system.

Environment variables are declared in namespaced .env files using yaml syntax. The default namespace is stack and variables are declared in stack.env files.

Quickstart

To create a new environment stack, create a new namespaced .env file. For example, here is a simple thing.env file (namespace is "thing"):

all: &default
  FOO: bar

To see the resolved environment for the thing stack, run:

$ envstack thing
FOO 'bar'

Environment stacks are hierarchical, so values for $FOO defined in .env files lower in the filesystem (lower in scope) override those defined higher up (higher in scope):

/show/thing.env
/show/seq/thing.env
/show/seq/shot/thing.env
/show/seq/shot/task/thing.env

Variables can reference other variables defined elsewhere (but cannot be circular):

all: &default
  BAR: $FOO

Variables can be platform specific (and inherit the defaults):

linux:
  <<: *default
  HELLO: world

Environment files can include other namespaced environments:

include: ['other']

Installation

The easiest way to install:

$ pip install envstack

Usage

To see the default resolved environment for any given scope (directory):

$ envstack

To see the resolved environment for a given namespace.

$ envstack <namespace> [OPTIONS]

To resolve a $VAR declaration for a given namespace:

$ envstack <namespace> -r <VAR>

To trace where a $VAR declaration is being set:

$ envstack <namespace> -t <VAR>

To see an environment stack on another platform:

$ envstack <namespace> -p <platform>

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

envstack-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

File details

Details for the file envstack-0.1.0.tar.gz.

File metadata

  • Download URL: envstack-0.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for envstack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88b17629b99003769e790378b8194337b582d250d480b2cb4ec0ee84e7c62c97
MD5 30ed36f1f84798b9387d955489d2cf26
BLAKE2b-256 0089040c7d1c05c06a54362c4d97fd1f8d4ca0b149e89f7c3b91f9281318f194

See more details on using hashes here.

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