CLI tool to load heroku env vars from local .env files
Project description
heroku.env
Simple CLI tool to upload environment variables to Heroku from a .env file, through the Heroku CLI Toolbelt.
Free software: MIT license
Disclaimer
I’m a beginner when it comes to Python libraries. I’ve been working on Django for over a year and that encompasses all my experience with Python. This library was a quick personal project because we use Heroku a lot at work and I find it really annoying when you have to add env vars manually from your local environment every time. This is also my first venture into open source Python and my very first library on PyPI. If you’re a rockstar dev reading this, I cannot be happier and I cannot tell you how much your feedback would mean to me :) Thanks.
Installation
pip install heroku.env
Requirements
Python 2.7+
Heroku CLI (Toolbelt) installed.
A valid Heroku app name is required to run against.
The absolute/relative path to the .env file is also needed, but if not provided, “.env” will be used as the default, which expects a file named .env to be present in the current working directory.
Your Heroku API key (found here or by running this) is also mandatory, which must be set as an environment variable (as HEROKU_API_KEY before running the tool) or passed with –api-key or -k.
Usage
If the API key is set as an environment variable, it will be automatically read.
If it is not set, you will be given a password-type prompt to enter it.
It is recommended for security purposes that you set it as an environment variable before running the tool, like this:
$ export HEROKU_API_KEY=a1b12c24-ab1d-123f-5678-1234b12a0a1b
Example usages:
This is perfect.
$ heroku.env --app swimming-briskly-123 --env-file dot.env
This is not recommended, but still available as an option.
$ heroku.env --app swimming-briskly-123 --env-file dot.env --api-key a1b12c24-ab1d-123f-5678-1234b12a0a1b
See all options by:
$ heroku.env --help
Features
Auto-setting of all env vars from a .env file
Lines starting with # are considered comments and ignored
Secure, does not store your API key anywhere.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template. This is also inspired by a script by sdkcodes.
History
0.2.0 (2018-12-24)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for heroku.env-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9901561733804b3fd267e37e5771042efadddef0193a6f9f189a1d1eabba6efe |
|
MD5 | 8036c3c900bbe919c3bb579e0d7d8e2b |
|
BLAKE2b-256 | 59c0088da20ca6f7d2d87fe9946fe451db125f2319f99765450b9660812e76f5 |