Skip to main content

Python bindings for murk — encrypted secrets manager

Project description

murk-secrets

PyPI

Python bindings for murk — an encrypted secrets manager for developers.

murk stores encrypted secrets in a single .murk file safe to commit to git. This package lets Python apps read those secrets at runtime.

Prerequisites

You need the murk CLI to create and manage vaults. This package only reads them.

# Install the CLI first
brew tap iicky/murk && brew install murk

# Initialize a vault and add secrets
murk init
murk add DATABASE_URL
murk add API_KEY

Then add the Python package to your project:

pip install murk-secrets

Quick start

# Load your key (created by murk init)
source .env
import murk

# Load the vault (reads MURK_KEY from environment)
vault = murk.load()

# Get a single secret
db_url = vault.get("DATABASE_URL")

# Get all secrets as a dict
secrets = vault.export()

# Dict-style access
api_key = vault["API_KEY"]

API

murk.load(vault_path=".murk") -> Vault

Load and decrypt a murk vault. Reads MURK_KEY or MURK_KEY_FILE from the environment.

murk.get(key, vault_path=".murk") -> str | None

One-liner: load the vault and get a single value.

murk.export_all(vault_path=".murk") -> dict[str, str]

One-liner: load the vault and export all secrets as a dict.

murk.has_key() -> bool

Check if a MURK_KEY is available in the environment.

Vault

Method Returns Description
vault.get(key) str | None Get a single decrypted value
vault.export() dict[str, str] All secrets as a dict
vault.keys() list[str] List of key names
vault[key] str Dict-style access (raises on missing key)
key in vault bool Check if a key exists
len(vault) int Number of secrets

Scoped (per-user) overrides are applied automatically — if you have a scoped value for a key, it takes priority over the shared value.

Agent policy

When the loaded key is an agent grant (minted with murk agent grant), the vault's agent policy is enforced on read, the same way the CLI enforces it at murk agent exec: get() and export() raise RuntimeError if the policy forbids a key. Operator keys are unaffected. This makes a policy vault strict from every entry point — though an agent already cannot decrypt out-of-scope secrets at all, since its ephemeral key is not a recipient of them.

Environment

Set one of:

  • MURK_KEY — your age secret key directly
  • MURK_KEY_FILE — path to your key file (created by murk init)

The easiest setup is source .env in your project directory after running murk init.

Requirements

  • Python >= 3.9
  • murk CLI installed (to create and manage vaults)
  • A .murk vault file in your project (created with murk init)
  • MURK_KEY or MURK_KEY_FILE in the environment (created by murk init, loaded via source .env)

License

MIT OR Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

murk_secrets-0.7.0.tar.gz (5.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

murk_secrets-0.7.0-cp312-cp312-win_amd64.whl (888.1 kB view details)

Uploaded CPython 3.12Windows x86-64

murk_secrets-0.7.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

murk_secrets-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

murk_secrets-0.7.0-cp312-cp312-macosx_11_0_arm64.whl (995.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

murk_secrets-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file murk_secrets-0.7.0.tar.gz.

File metadata

  • Download URL: murk_secrets-0.7.0.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for murk_secrets-0.7.0.tar.gz
Algorithm Hash digest
SHA256 845d40f7edca5fb7418a0db47b5ddc5f4c565ec480e184e3df13d717e14611e9
MD5 d495647c2d3386d4c09ac929570301c9
BLAKE2b-256 e88f422cd96f8a2bbc3dc981b3044fdbd9314ee1f939684eecce16c26483beb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.7.0.tar.gz:

Publisher: python.yaml on iicky/murk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file murk_secrets-0.7.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3e60792ac0ed6ecdaf7e50360c2ed1ea8e8a0f4e0dd2cac92f87e61bf4a6ed34
MD5 9486195faa6e9af4e3e5e7e2caca2ded
BLAKE2b-256 a63dee332306840eff1b7ecd444709a2dcf91b5897cb476da00c4e90751a5b11

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.7.0-cp312-cp312-win_amd64.whl:

Publisher: python.yaml on iicky/murk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file murk_secrets-0.7.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.7.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d3f546cfe98385565365aad3600af6ae090c5217220f33a2b9b225848a654e7d
MD5 5c219e87f8c8b0d574ae1fe221b73d1a
BLAKE2b-256 65d2aeecae62e08bfc3baad5e0a48cc5bd94915cc15515967085711360470905

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.7.0-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: python.yaml on iicky/murk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file murk_secrets-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8d9d8c255de4400e5656823425cc105cc0f663dcdd4a40083c339acced423f0
MD5 5620e1e2c6400891b35b657406597dc3
BLAKE2b-256 592aa67b463eb802d0052de01d5e429e2dc6958284cb1a775991a2c195d0f2df

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python.yaml on iicky/murk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file murk_secrets-0.7.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adfa94988dc6ccdc157e0b3a4bf79f0f22287f34f8d613eb51d1855a601b8c64
MD5 5d2a71d75e777715d5a2153feae2ec5d
BLAKE2b-256 a31a6df5596ce5e45f074fda55375664212465b38759a88542edf4af9c6da6c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.7.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python.yaml on iicky/murk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file murk_secrets-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f2df43398561dd2bfb35ed15267ec4dd74294ab4cb55c4d18a107ef1109b80cd
MD5 5e6a21b74920829c93132c0c6af96f04
BLAKE2b-256 c09d0bbfc5328b52a8b4a942aaa426815b271eca4216c7db44011cee1b892f56

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: python.yaml on iicky/murk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page