Skip to main content

Python SDK for the Musher bundle distribution platform

Project description

Musher Python SDK

CI PyPI

Python SDK for the Musher bundle distribution platform. Pull versioned AI agent asset bundles (prompts, configs, tool definitions) into your Python applications.

Installation

pip install musher-sdk

Quick Start

import musher

# Explicit token
musher.configure(api_key="your-token")

bundle = musher.pull("myorg/my-bundle:1.0.0")

for asset in bundle.files():
    print(f"{asset.logical_path}: {len(asset.text())} chars")

Async

async with musher.AsyncClient() as client:
    bundle = await client.pull("myorg/my-bundle:1.0.0")

Sync

with musher.Client() as client:
    result = client.resolve("myorg/my-bundle:1.0.0")
    asset = client.fetch_asset("asset-id", version="1.0.0")

Configuration

Credential Chain

The SDK resolves credentials automatically in this order:

  1. Environment variablesMUSHER_API_KEY
  2. OS keyring — host-scoped service musher/{hostname}
  3. File fallback<data_dir>/credentials/<host_id>/api-key (must be 0600 permissions)

Registry URL

The registry URL is resolved from environment variables:

  • MUSHER_API_URL
  • Default: https://api.musher.dev

Programmatic Configuration

import musher

# All parameters are optional — omitted values auto-discover
musher.configure(
    api_key="your-token",  # or token="your-token"
    api_url="https://custom.dev",  # or registry_url="https://custom.dev"
    cache_dir=Path("/tmp/cache"),
)

Cache Behavior

The SDK uses a content-addressable disk cache:

  • Blobs are stored by SHA-256 hash (shared across registries)
  • Manifests and refs are partitioned by registry hostname
  • Manifests have a configurable TTL (default 24h); refs default to 5min
  • clean() removes expired entries and garbage-collects unreferenced blobs

What's Implemented

  • resolve() — resolve bundle references to manifests
  • fetch_asset() — fetch individual assets by ID
  • pull() — resolve + fetch all assets + verify checksums
  • Sync (Client) and async (AsyncClient) clients
  • Content-addressable cache with TTL and garbage collection
  • Typed handles: skills, prompts, toolsets, agent specs

What's Stubbed

  • export_claude_plugin(), install_vscode_skills(), install_claude_skills()
  • write_lockfile(), verify()
  • OCI direct pull (OCIClient)

License

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

musher_sdk-0.1.0.tar.gz (195.5 kB view details)

Uploaded Source

Built Distribution

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

musher_sdk-0.1.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file musher_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: musher_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 195.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for musher_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ae35289e1853611d54947704c0f0f8eba09b460a9956778c84e9e2f6304d505
MD5 caa30a02dca03d7b4b1f67fa7a59a92c
BLAKE2b-256 dec629b343f822cfc0d2dfb8e07b5b2a1e71cd6345dc26fe8a3848395cb8bdf8

See more details on using hashes here.

File details

Details for the file musher_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: musher_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for musher_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab121a817182d9a3feae1c1120166c42e23636deb126aa57300e10f02e7d4860
MD5 9cd464f454ed7c18d4b2338cd57a9fd1
BLAKE2b-256 ba6195ecae1aa90eff6ab19da407a8d6b73a0ea2fc1baedf72c687182c203ac3

See more details on using hashes here.

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