Safe Environment Manager allows to manage secrets in environment variables in a safe way.
Project description
Safe Environment Manager (safe-env)
Safe Environment Manager allows to manage secrets in environment variables in a safe way. To achieve this, safe-env follows a set of principles:
- Configurations for different environments are stored in a set of yaml files, that have no secrets and can be safely pushed to git repository.
- Secrets are never written to local files, even temporarily (Note: also it is possible to save the output in the file, this is not recommended, and should be considered only as an exception for short term temporary use).
- Secrets are stored in one of the following safe locations:
- the resource itself (for example, access key in Azure Storage Account configuration);
- external vault (for example, Azure KeyVault);
- local keyring;
- environment variables (in memory).
- Access to required resources and vaults is controlled via standard user authentication mechanisms (for example,
az loginor interactive browser login for Azure).
When developer is on-boarding to a new project, that uses regular .env files, the process usually looks like this:
There are many steps involved, and a lot of opportunities for secrets to leak along the way. In addition, the secrets end up in unsecure places - local .env file in project folder, or environment variables on development machine.
safe-env helps to simplify on-boarding process, and ensure that secrets are stored only in-memory or in secure storage.
This also allows to quickly switch between environments while developing, testing, or using software.
More info:
- Documentation: https://antonsmislevics.github.io/safe-env
- Repository: https://github.com/antonsmislevics/safe-env
Getting started
How to install?
The package can be installed using pip:
python -m pip install safe-env
If using uv, it can be installed globally as a tool or as a dev dependency in specific project:
# install as a tool
uv tool safe-env
# or add as dev dependency
uv add safe-env --dev
Latest dev version can also be installed directly from git repository:
# pip
python -m pip install git+https://github.com/antonsmislevics/safe-env.git
# uv as a tool
uv tool install git+https://github.com/antonsmislevics/safe-env.git
# uv as dev dependency
uv add git+https://github.com/antonsmislevics/safe-env.git --dev
The package does not require to be installed in the same virtual environment that is used for development.
How to use?
When the package is installed, safe-env can be invoked from the command line as se or as python -m safe_env.
To check the version of the tool, run:
se --version
# or
python -m safe_env --version
To get a list of all available commands and options, run:
se --help
# or
python -m safe_env --help
Congratulations! Now you are ready to create environment configuration files.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safe_env-0.1.5.tar.gz.
File metadata
- Download URL: safe_env-0.1.5.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b9180fe1808b8cbc4e0edb31f09a98b470ffcf91ae18d1a50505c4d22924153
|
|
| MD5 |
deba6632907ccc7d5d74b0b04b17e240
|
|
| BLAKE2b-256 |
4999ad6064c6e27346fe2cfbc0f0de102a548f0f324950e6bd812eafc92686d8
|
File details
Details for the file safe_env-0.1.5-py3-none-any.whl.
File metadata
- Download URL: safe_env-0.1.5-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e740a42cc5da7c097c5221c7201d71581ed79c5895c35d359ba806cbf58f70a
|
|
| MD5 |
079ba31fa96b240e2aa0f2dfe015f119
|
|
| BLAKE2b-256 |
c72231f3da4e02b70809bdecddd888f409a71cd88bceb60d15dcdf24b8f5986e
|