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.8.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.8.0-cp312-cp312-win_amd64.whl (971.7 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

murk_secrets-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

murk_secrets-0.8.0-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

murk_secrets-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: murk_secrets-0.8.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.8.0.tar.gz
Algorithm Hash digest
SHA256 b17df34a52fad9ad97d4eb950cc2154a71049dde08ad778758dd2305c2d41763
MD5 914d852eee6aa365528bf341b38cc0a4
BLAKE2b-256 d41c9abb8fdea46cc8c5a4161b5a2237b0703ec15c5a332d5778af8bf451a890

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.8.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.8.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 21b2892dd4431242730cccba84b4fc2087d4917f2f238d2bf4052a88343e60a9
MD5 897fe2906205b761465bce16c440d456
BLAKE2b-256 0cf286cbc9020a38d529b49421952624f1132377bf6cfc1dad73ccd86be93682

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.8.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.8.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.8.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4e6723453ae8a62dcea672b0f5903452d3768c13d38cb64295fc5b04160ff2a0
MD5 94d11861e6f918eb31427e3027f0fc83
BLAKE2b-256 a6602813207c7c376a095c107a129ba393aa091727c29a338ea94f4323cf7797

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.8.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.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f093d77ff7e60013c36be99784c73953c4d951b24f4dd5ed1970273b4f2ff0aa
MD5 f6839601e91183a30ba19fd3d6f63200
BLAKE2b-256 347827f139cf21f29b068cace3c743d067c5ce812028f146c9bddc9e5f61f5a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.8.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.8.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3914fecd6f9febdde8e4dba675050145789b26d55952bed25afa7d03703b88bf
MD5 a4d1c58bbe9228c58766c3ca4f20905e
BLAKE2b-256 b0940811deb9c8b350f88e15fc3dc080d7f3745ea84c5a60204ea305739b7b13

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.8.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.8.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for murk_secrets-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c7b8cb89aee740f00a86e6bb1ba52908541e2507cc3b507d542df1435480041a
MD5 8c39ec0317a97ed2fe06a092bd313e65
BLAKE2b-256 1982d9002e8656970f77265c17d70840f03f848a87208bfc8bb9290bb084bb77

See more details on using hashes here.

Provenance

The following attestation bundles were made for murk_secrets-0.8.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