Python Server Sync
monoverse is a Python package that pushes your Python catalog and content to Monoverse so
the assistant can answer about your real products, categories and pages.
It is a producer client for the Monoverse canonical signed-ingest contract: it pairs once, sends a
full snapshot to establish a baseline, then streams small incremental deltas as your data
changes. Everything runs server-to-server over an HMAC-signed HTTP protocol — no browser, no
end-user involvement, no LLM SDK on your side. Voice and retrieval stay on the Monoverse backend. It is
the Python twin of the @monoverse/node and
Laravel/WordPress sync producers.
┌──────────────────┐ gzip-NDJSON snapshot ┌──────────────┐
│ Your Python app │ + signed /events deltas │ Monoverse │
│ + this package │ ───────────────────────────▶ │ ingest │
│ (entity │ HMAC-SHA256, https only │ (catalog, │
│ builders) │ │ RAG) │
└──────────────────┘ └──────────────┘
The widget answers questions using this data. Until a backend sync runs, there is nothing for it to talk about. Get the catalog in first.
The lifecycle at a glance
Four steps from an empty connection to a self-maintaining feed:
- Pair —
client.ensure_paired()proves your site's domain with itspk_key and stores your tenant id + an encrypted shared secret. - Map — build canonical entities from your data with the typed builders (
product,category, …). - Snapshot —
client.snapshot(...)streams a complete baseline of every kind you emit. - Schedule — deltas every few minutes via
client.send_events(...), plus a periodic full to reconcile deletes.
Two channels, two keys
Monoverse reads your store over two independent channels. They use different credentials and flow in opposite directions — don't confuse them.
| Data channel (this package) | Widget channel (browser) | |
|---|---|---|
| Direction | Your server → Monoverse (push) | End-user browser ↔ Monoverse (live) |
| Credential | HMAC shared secret (per-tenant, secret) | Publishable key pk_… (public, embeddable) |
| Obtained via | client.ensure_paired(), pairing with your site's pk_ | Copied from the cabinet, dropped in a <script> |
| Carries | Catalog + content snapshots and deltas | Voice/text conversation traffic |
| Trust | Secret, encrypted at rest, never logged | Public identifier, safe to ship in markup |
The shared secret minted by pairing is stored encrypted at rest (AES-256-GCM, keyed by your
encryption_key) and is never printed, logged, or returned in any output.
When to use it
Use this package when:
- Your storefront runs on Python (Django, FastAPI, Flask, a headless backend, a custom shop).
- You want the assistant to answer about live products, prices, stock, categories and pages.
- You can run a script on a schedule (cron, Celery beat, a worker, a platform scheduler).
You do not need this package if your store runs on WordPress/WooCommerce (use the WordPress sync plugin) or Laravel (use the Laravel package), or if you'd rather not run a producer at all.
If you can't run a producer, Monoverse can ingest your store with no code on your side — a managed crawler reads your public pages, and supported platforms can be pulled read-only. See No-code & read-only alternatives.
What it sends
The package maps your data to Monoverse's canonical entity schema via typed builder functions and
emits the kinds you have — products, categories, pages and more. Money is integer minor units,
categories/tags are slug lists, and page(content_text=...) is plain text; the builders enforce
these. See Mapping for how to build entities and Syncing for how to
push them.
Requirements
- Python 3.11+ (depends on
httpx,pydantic,cryptography; shipspy.typed). - A full-entropy 32-byte
encryption_keyto encrypt the stored shared secret (openssl rand -hex 32). - A reachable Monoverse ingest endpoint over https (
localhostis allowed for local dev).
The five-minute path
- Install & pair — install the package, construct the client with your
pk_, mount/monoverse, callensure_paired(). - Map your data to canonical entities.
- Push a baseline:
client.snapshot(catalog()). - Sync deltas + a periodic full.
- Operate it —
status,unpair, retries, scheduling.
Next steps
- Installation & pairing — install, construct the client, pair.
- Ingest Protocol Reference — the contract this package implements.
- Tenant isolation — how the HMAC plane stays scoped to your tenant.