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
Use this from wasmmod / CI. Do not install pymergetic-metal-cdn just to publish — that pulls the FastAPI server stack.
Install
pip install pymergetic-metal-cdn-client
# from this monorepo (sources under ../pymergetic/metal/cdn_client):
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.0a5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymergetic_metal_cdn_client-0.1.0a5.tar.gz | 2.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymergetic_metal_cdn_client-0.1.0a5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.6 kB
Release files / pymergetic_metal_cdn_client-0.1.0a5.tar.gz
| Download URL | pymergetic_metal_cdn_client-0.1.0a5.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a15b1cb551f0815f2a8619f3daf46057d8820827a1daa9d461ee1a98a3a4d594
|
|
BLAKE2b-256 checksum How to use checksums |
3f64e94c80d1fd3cd291053f4f1c8b8a3617ea4d5b0c2e142e591f6fdbe30817
|
| 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_client-0.1.0a5-py3-none-any.whl
| Download URL | pymergetic_metal_cdn_client-0.1.0a5-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b81006f8f39756f593685b8f2e2423da5a263f14b6587b99a180521971d3b7f
|
|
BLAKE2b-256 checksum How to use checksums |
0cf6e125cf86537e7518a847a884ef320fa2703d2419207f5d44c869c34a17da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|