Skip to content
/ clrenv Public
forked from color/clrenv

Easily set environment variables from Python.

License

Notifications You must be signed in to change notification settings

snarfed/clrenv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clrenv

A tool to give easy access to environment yaml file to python.

Getting Started

  • Install clrenv
$ git+https://github.com/color/clrenv.git@v0.1.6
  • Create a file called environment.yaml.
# environment.yaml
base:
  name: foo
  location: sf
  • Set a path to the file.
$ export CLRENV_PATH=/path/to/environment.yaml
  • Access env varianble from python
> from clrenv import env
> env.name
=> "foo"
> env.location
=> "sf"

Add a mode

  • Edit the environment.yaml file.
# environment.yaml
base:
  name: foo
  location: sf

production:
  location: nyc
  • Set a mode:
$ export CLRENV_MODE=production
  • Access env varianble from python
> from clrenv import env
> env.name
=> "foo"
> env.location
=> "nyc"

Add an overlay

  • Create a file called environment.overlay.yaml.
# environment.overlay.yaml
base:
  name: bar
  • Set a path to the file.
$ export CLRENV_OVERLAY_PATH=/path/to/environment.overlay.yaml
  • Access env variable from python
> from clrenv import env
> env.name
=> "bar"
> env.location
=> "sf"

CLRENV_OVERLAY_PATH may have multiple files separated by :, e.g. /path/foo.overlay.yaml:/path/bar.overlay.yaml.

About

Easily set environment variables from Python.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%