faceplant
Build a faceplant platform service in ~30 lines. Identity, the 30-second broker heartbeat, dashboards, the runtime plugin host, the daily garbage collector, and MCP tool serving are all under the hood — you write domain code.
pip install faceplant
Quickstart — a whole service
from faceplant import Service, Table, Column
svc = Service(
"billing",
description="Track usage bills.",
icon="receipt",
category="tools",
)
@svc.get("/data")
async def bills(user): # user.email, user.slug, user.dir
rows = load_bills(user.dir) # per-user private storage, created for you
return Table(
title="Bills",
columns=[Column(key="month", header="Month"),
Column(key="amount", header="Amount")],
rows=rows,
)
@svc.responder("billing.total") # a broker API other services can call
async def total(data):
return {"total": sum_bills()}
app = svc.app # uvicorn src.main:app
That's the entire service. Service(...) already gave you:
- a gateway card heartbeated every 30s (stop the pod → the card disappears);
/health,/manifest,/_pluginsand CORS;- identity:
useris injected from the platform JWT (401 when absent), withuser.dirfor per-user storage anduser.tags/user.services; - the runtime plugin host: other services can extend this one with signed
wheels, with zero code here (
svc.registryif you want to add hook points); - the daily GC that reclaims a user's data ~10 days after they're gone.
More surfaces (each one decorator)
@svc.consumer("CHAT", filter_keys=["chat.>"]) # subscribe to broker events
async def on_chat(data): ...
@svc.mcp_tool() # a tool for coding agents (pip install faceplant[mcp])
async def get_bill(month: str) -> str: ...
svc.announce_wheel(target="faceplant-users", # ship an extension wheel AT another service
wheel="plugin", entrypoint="billing_gate.plugin:register")
@svc.manifest # compute the dashboard per request
def dash(user): return Stack(children=[...])
Escape hatches, always available: svc.app is a real FastAPI app (add
WebSockets, SSE, middleware); svc.broker.request(key, data) / .publish(...);
await svc.provision(fn) for blocking work off the DNS-critical event loop;
@svc.background for startup loops; @svc.on_purge / @svc.gc_verdict to
customize GC.
Testing is safe by default
Service only starts its heartbeat when a broker is actually configured
(BROKER_URL set). A bare pytest or with TestClient(app) runs offline —
no accidental registration against a live gateway. To test online behavior, use
the in-process stub:
from fastapi.testclient import TestClient
from faceplant.testing import StubBroker, dev_jwt
def test_bills():
with TestClient(svc.app) as client: # offline: no heartbeat
r = client.get("/data", headers={"authorization": f"Bearer {dev_jwt('a@b.co')}"})
assert r.status_code == 200
async def test_registration():
stub = StubBroker(); stub.install(svc)
await stub.beat(svc)
assert "billing.total" in stub.responders
Deployment is boilerplate-free too
Your repo needs no Dockerfile and no k8s/values-prod.yaml — the SDK
generates them. A deployable service is just src/main.py, pyproject.toml,
and a ~10-line deploy workflow that calls the SDK's reusable one:
jobs:
deploy:
uses: faceplant-ai/faceplant-sdk/.github/workflows/deploy-service.yml@v1
with: { service: billing, kind: stateless }
secrets: inherit
Or generate the files to check in: faceplant init --name billing. See
docs/deployment.md.
Docs
One page per concept in docs/: identity,
widgets, plugin-host,
providers,
consumers & responders, mcp,
gc, escape hatches,
testing, and
migrating from the template.
License
MIT.
Metadata
Release files for faceplant 0.9.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| faceplant-0.9.7.tar.gz | 202.5 kB | Without provenance | Details for faceplant-0.9.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| faceplant-0.9.7-py3-none-any.whl | Python 3 | none | any | Details for faceplant-0.9.7-py3-none-any.whl |
Total release size: 288.7 kB
Release files / faceplant-0.9.7.tar.gz
| Download URL | faceplant-0.9.7.tar.gz |
|---|---|
| Size | 202.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea0d1f3373c109485cfce7f1d36dcb98196e766de7e57da6cc7865dbb9ede07f
|
|
BLAKE2b-256 checksum How to use checksums |
9faf60a8c1eea7e5cc5154488e68d2f02ea995cf2855b105a973f6e162f2accc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / faceplant-0.9.7-py3-none-any.whl
| Download URL | faceplant-0.9.7-py3-none-any.whl |
|---|---|
| Size | 86.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f72cabe651c609d82dfa2bd9c61732e05116ebb7a116325cb9c69b47697100d
|
|
BLAKE2b-256 checksum How to use checksums |
fc58e1529afcace58701e3acd6ffc24cdddd6446597b76ca886f3c504de8e1ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for faceplant 0.9.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.