A tool to give easy access to environment yaml file to python.
- Install clrenv
$ git+https://github.com/color/[email protected]
- 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"
- 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"
- 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
.