Skip to main content

EnvCP Python Binding

Native Python binding for EnvCP - an encrypted environment variable vault with AI access policies. Built on Rust + PyO3 for zero-dependency native performance.

Installation

pip install envcp-core

Or with pipx:

pipx install envcp-core

Usage

from envcp import encrypt, decrypt, StorageManager

# Crypto operations
ciphertext = encrypt("my-secret-value", "my-password")
plaintext = decrypt(ciphertext, "my-password")

# StorageManager for encrypted vault files
sm = StorageManager("~/.envcp/vault.json", encrypted=True)
sm.set_password("my-password")

# Load, get, set, delete, list
vault_json = sm.load()
sm.set("API_KEY", '{"value":"secret","protected":false}')
sm.get("API_KEY")
sm.list()
sm.delete("API_KEY")

API Reference

Crypto Functions

Function Description
encrypt(plaintext, password) -> str AES-256-GCM encrypt with Argon2id
decrypt(ciphertext, password) -> str Decrypt v1 (PBKDF2) or v2 (Argon2id)
hash_password(password) -> str Argon2id password hash
verify_password(password, hash) -> bool Verify password hash
generate_recovery_key() -> str Generate 32-byte recovery key
create_recovery_data(password, key) -> str Create encrypted recovery blob
recover_password(data, key) -> str Recover password from recovery data
hmac_sign(key, data) -> str HMAC-SHA256 signature
hmac_verify(key, data, expected) -> bool Timing-safe HMAC verification
generate_id() -> str Random ID
generate_session_token() -> str Session token

StorageManager Class

Method Description
StorageManager(path, encrypted=True) Create manager for vault at path
set_password(password) Set encryption password
invalidate_cache() Clear in-memory cache
exists() -> bool Check if vault file exists
load() -> str Load full vault as JSON string
get(name) -> Optional[str] Get single variable as JSON
set(name, var_json) Set variable (var_json is JSON string)
delete(name) -> bool Delete variable, returns True if existed
list() -> List[str] List all variable names

Requirements

  • Python 3.9+
  • No Node.js dependency (native Rust binding)

Building from Source

git clone https://github.com/fentz26/EnvCP
cd EnvCP
cargo build --release -p envcp-python

For wheel distribution:

pip install maturin
cd crates/envcp-python
maturin build --release

Metadata

Release files for envcp 1.2.0

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

Source distribution (sdist)

Source distribution for envcp 1.2.0
File Size Uploaded Provenance Actions
envcp-1.2.0.tar.gz 3.3 kB With provenance Details for envcp-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for envcp 1.2.0
File Interpreter ABI Platform Actions
envcp-1.2.0-py3-none-any.whl Python 3 none any Details for envcp-1.2.0-py3-none-any.whl

Total release size: 6.8 kB

Release files / envcp-1.2.0.tar.gz

Download URL envcp-1.2.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d162b32616574bde30179d4cfe4e8b1e1fe2892008edbc9894dd048be35163f5
BLAKE2b-256 checksum
How to use checksums
1085c96db4cfd3429e415efb00a69cb2e94bd526c75ed41bda3f10a136a20f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.

Transparency log

Release files / envcp-1.2.0-py3-none-any.whl

Download URL envcp-1.2.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8746869f726ba3fd6fc9af834248d900eaf863cedf8e55964f167e655804408c
BLAKE2b-256 checksum
How to use checksums
f70aa1690c3425f6c117a6982d3efd78626bd4673c60ad23e921aa2c3c2a9110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.

Transparency log

Security for envcp 1.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for envcp-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.

Transparency log

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