Skip to main content

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:

  1. Configurations for different environments are stored in a set of yaml files, that have no secrets and can be safely pushed to git repository.
  2. 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).
  3. 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).
  4. Access to required resources and vaults is controlled via standard user authentication mechanisms (for example, az login or 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:

Developing without safe-env

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.

Developing with safe-env

This also allows to quickly switch between environments while developing, testing, or using software.

More info:

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.

Metadata

Release files for safe-env 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for safe-env 0.1.5
File Size Uploaded Provenance Actions
safe_env-0.1.5.tar.gz 16.7 kB Without provenance Details for safe_env-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for safe-env 0.1.5
File Interpreter ABI Platform Actions
safe_env-0.1.5-py3-none-any.whl Python 3 none any Details for safe_env-0.1.5-py3-none-any.whl

Total release size: 41.9 kB

Release files / safe_env-0.1.5.tar.gz

Download URL safe_env-0.1.5.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6b9180fe1808b8cbc4e0edb31f09a98b470ffcf91ae18d1a50505c4d22924153
BLAKE2b-256 checksum
How to use checksums
4999ad6064c6e27346fe2cfbc0f0de102a548f0f324950e6bd812eafc92686d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.15

Release files / safe_env-0.1.5-py3-none-any.whl

Download URL safe_env-0.1.5-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e740a42cc5da7c097c5221c7201d71581ed79c5895c35d359ba806cbf58f70a
BLAKE2b-256 checksum
How to use checksums
c72231f3da4e02b70809bdecddd888f409a71cd88bceb60d15dcdf24b8f5986e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.15

Security for safe-env 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page