Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pymergetic-metal-cdn-client

Thin HTTP client for metal-cdn (urllib + Pydantic models for typed package contents).

PyPI: pymergetic-metal-cdn-client
Import: pymergetic.metal.cdn_client

Component Role Repo
wasmmod Runtime + pack tree pymergetic/wasmmod · main
wasmmod-tools Host CLI (optional CDN extras) pymergetic/wasmmod-tools · main
wasmmod-test External consumer sample pymergetic/wasmmod-test · main
metal-cdn This package lives here — server + client pymergetic/metal-cdn · main / client/
metalpython wasmmod Clean upy host + submodule (upstream-shaped) metalpython/tree/wasmmod
metalpython master Metal product µPy; base = wasmmod tip metalpython/tree/master

Use this from wasmmod / CI. Do not install pymergetic-metal-cdn just to publish — that pulls the FastAPI server stack.

Install

# alphas need --pre until a stable release
pip install --pre pymergetic-metal-cdn-client
# from this monorepo (sources under ../pymergetic/metal/cdn_client):
pip install --pre 'pymergetic-wasmmod-tools>=0.1.0a1'
pip install -e ./client --config-settings editable_mode=compat

Auth contract

All authenticated calls use Authorization: Bearer <token>.

Today the token is an API key from POST /auth/token (password login).
OIDC / passkeys are not implemented in this client; when the server adds them they will mint or refresh a Bearer token. Config reserves token_source (api_key now, oidc later). Publish/claim stay token-agnostic.

Config file: ~/.config/metal-cdn/config.json

{
  "url": "http://127.0.0.1:8000/cdn",
  "token": "mcdn_…",
  "email": "you@example.com",
  "token_source": "api_key"
}

Usage

from pathlib import Path
from pymergetic.metal.cdn_client import CdnClient, save_config

client = CdnClient("http://127.0.0.1:8000/cdn")
created = client.create_api_key_with_password("you@example.com", "secret", name="cli")
save_config({
    "url": "http://127.0.0.1:8000/cdn",
    "token": created["key"],
    "email": "you@example.com",
})

authed = CdnClient.from_config()
authed.claim("hello")
authed.publish(
    package="hello",
    version="0.1.0",
    files=[Path("hello.wasm")],
)
entry = authed.get_package("hello")
blob = authed.download_artifact("hello.wasm")

wasmmod

wasmmod owns pack → AOT → sign → zlib. This library is only the upload/download step:

pack → aot → sign → zlib → CdnClient.publish(...)

Metadata

Release files for pymergetic-metal-cdn-client 0.1.0a11

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

Source distribution (sdist)

Source distribution for pymergetic-metal-cdn-client 0.1.0a11
File Size Uploaded
pymergetic_metal_cdn_client-0.1.0a11.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymergetic-metal-cdn-client 0.1.0a11
File Interpreter ABI Platform
pymergetic_metal_cdn_client-0.1.0a11-py3-none-any.whl Python 3 none any Details

Total release size: 39.7 kB

Release files / pymergetic_metal_cdn_client-0.1.0a11.tar.gz

Download URL pymergetic_metal_cdn_client-0.1.0a11.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d438bcc4db604ee6bfb6d6a9a1077e648eeae941d0caa5cecee0e5a9505de9d6
BLAKE2b-256 checksum
How to use checksums
dafa78bddeddd89fdcd961d389c8f655e9497f6a105bf40a492611e67e24770f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pymergetic_metal_cdn_client-0.1.0a11-py3-none-any.whl

Download URL pymergetic_metal_cdn_client-0.1.0a11-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed2afad594c66818376b98fae2a3f29a231558ce7053e3e41213ff65130206f0
BLAKE2b-256 checksum
How to use checksums
fec630eb8a9824fb6e9672fb48e78538563dcc1834f3a1290271fd48747457e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14
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