Skip to main content
Pre-release

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

metal-cdn

PyPI: pymergetic-metal-cdn · Client: pymergetic-metal-cdn-client
Live demo: cdn.pymergetic.com/cdn · Pack format: wasmmod

Async FastAPI channel for signed wasmmod packs — browse, publish, inspect, and try them in a browser MicroPython shell.

Experimental. Data on the public demo is wiped often. Short tests only — not for production.

Package browse — hello on lead, dependents, µPy ready

Channel state (artifacts + index.json) lives in object storage.
Publisher identity (users + ACL) lives in SQL.
Devices still verify pack signatures with wasmmod — this service does not replace that.


What you get

Surface What it does
Browse Package tree, lead / @version pins, dependents
Artifacts Expand a .wasm / .zlib / AOT blob → pack file list
Source viewer Highlighted text (py / c / rs / toml / …) or hex for binaries
µPy shell In-browser MicroPython + wasmmod: import hello, packages()
Publish Multipart UI + CLI / thin client for CI

Browser µPy shell — session, CDN hook, live catalog


Inspect a pack

Click an artifact to open its guts — embedded Python (.py / .mpy / .pyc), natives, and optional wasmmod.source.

hello.wasm expanded — pack v3 file tree

Text files open with syntax highlighting; bytecode and other binaries get a hex dump.

Highlighted __init__.py from pack section   Highlighted pack.toml from embedded source

Hex view of a .pyc inside the pack


Install

pip install pymergetic-metal-cdn
# from this repo (client first — server depends on it):
pip install -e ./client -e ".[dev]" --config-settings editable_mode=compat

Thin publish/download wheel (no FastAPI): pymergetic-metal-cdn-client
→ pymergetic.metal.cdn_client — docs/CLIENT.md · client/README.md.

Version comes from git tags via setuptools-scm (metal-cdn --version).


Quick start

cd packages/metal-cdn
python3 -m venv .venv && source .venv/bin/activate
pip install -e ./client -e ".[dev]" --config-settings editable_mode=compat
cp .env.example .env
metal-cdn serve --reload
# → http://127.0.0.1:8000/cdn/        UI
# → http://127.0.0.1:8000/cdn/docs    OpenAPI

Docker one-shot

Rebuild browser µPy (if needed), sync REPL assets, docker build/run, seed sample packs:

./scripts/dev-up.sh
# → http://127.0.0.1:8000/cdn/   (µPy: packages() | import hello)

Flags: --no-upy, --no-seed, --seed-only.
Env: METALPYTHON, METAL_CDN_URL, METAL_CDN_PORT, METAL_CDN_SESSION_SECRET.

Public TLS edge

https://cdn.pymergetic.com/cdn/ — see docs/PROXY.md.

./scripts/dev-up.sh --no-upy
docker compose --profile proxy up -d nginx
curl -sf https://cdn.pymergetic.com/cdn/health

Try packs in the shell

The floating µPy panel warms MicroPython in the background. When status is ready:

packages()          # live lead catalog
import hello as m
print(dir(m))
m.greet()           # pack Python
  • GET /repl/autoexec.py mints/reuses a ShellSession, sets wasm.cdn + import hook + SESSION_ID
  • Pack/index hits with the session cookie show up under Sessions
  • Login claims prior anon sessions; Logout mints a fresh anon

Play button on a .wasm / .zlib / AOT row runs import <pkg> in the shell.


Client CLI

metal-cdn login --url http://127.0.0.1:8000/cdn --email you@example.com --register
metal-cdn claim hello
metal-cdn publish hello 0.1.0 ./hello.wasm ./hello.wasm.zlib
metal-cdn whoami

Web publish UI: {BASE_PATH}/publish after login.
One-shot pack→AOT→sign→zlib→upload: wasmmod.py publish (docs/CLIENT.md).
Releases / PyPI tags: docs/RELEASE.md.

Optional Postgres: docker compose up -d db + METAL_CDN_DATABASE_URL=….


Layout

client/pyproject.toml          # pymergetic-metal-cdn-client
pymergetic/metal/
  cdn_client/                  # thin HTTP client (shared sources)
  cdn/                         # FastAPI server + UI + REPL
screenshots/                   # UI stills for this README
from pymergetic.metal.cdn.main import create_app
from pymergetic.metal.cdn_client import CdnClient

API sketch

Method Path Role
GET /health /ready /metrics Liveness / readiness / Prometheus
POST /auth/* Register, login, token, API keys
GET /api/sessions Shell sessions for cookie principal
GET /repl/autoexec.py Browser µPy bootstrap
POST /packages/{name}/claim Claim ownership
GET /index/lead Device-facing index.json
GET /packages/{name}/closure Exact-deps install order
POST /publish Multipart publish
GET /artifacts/… Download / inspect / embedded files
metal-cdn db upgrade   # Alembic

Related

License

MIT — Rouven Raudzus (raudzus@pymergetic.com)

Metadata

Release files for pymergetic-metal-cdn 0.1.0a3

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 0.1.0a3
File Size Uploaded
pymergetic_metal_cdn-0.1.0a3.tar.gz 546.0 kB Details

Built distribution (wheel)

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

Total release size: 750.9 kB

Release files / pymergetic_metal_cdn-0.1.0a3.tar.gz

Download URL pymergetic_metal_cdn-0.1.0a3.tar.gz
Size 546.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cac72f90da099f76636bb4fdf79072da5e83905bd860a16eade0b3231576713b
BLAKE2b-256 checksum
How to use checksums
9f91d0f535872c2ae98f0058590f24f322fdce1f87607d34ab6f4b5e9906de39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pymergetic_metal_cdn-0.1.0a3-py3-none-any.whl

Download URL pymergetic_metal_cdn-0.1.0a3-py3-none-any.whl
Size 204.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e2260c2247751ea648a7e51487e863a54db377c4c5c51b98170931e2aac0fe7
BLAKE2b-256 checksum
How to use checksums
7d6251b8d4752b660ac5c9f98dbf0a2efc1181e13b58ff85bfac61e5ebd78657
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
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