On this page
expose-api
Prev: expose-interface | Up: projects | Next: carets
Rel: wispsy, Frameworks, compose-application
Ref: wispsy on GitHub
Tags: #public #wispsy #project #frameworks #tier/core
Role
Turn ordinary typed dataclasses into native ASGI 3 JSON CRUD applications—plus explicit HTTP routing, OpenAPI 3.1.0 generation, resource WebSocket events, and optional backpack-store persistence—with zero runtime dependencies (Python 3.14+).
Install
python -m pip install expose-api==0.2.0
# Optional persistent storage / compiled validation:
python -m pip install "expose-api[backpack]==0.2.0"
Quickstart
from dataclasses import dataclass, field
from uuid import UUID, uuid4
from expose_api import App, MemoryStore
@dataclass
class Note:
title: str
content: str = ""
id: UUID = field(default_factory=uuid4)
app = App(title="Notes API")
notes = app.include(Note, store=MemoryStore(), public=True)
if __name__ == "__main__":
app.run()
When to Reach for It
- Standing up a typed JSON CRUD service or explicit ASGI HTTP app directly from standard Python dataclasses.
- Note the boundary:
expose_apiserves APIs; apiconn consumes them.
Gotchas & Pitfalls
- Server-only boundary:
expose-apibuilds ASGI 3 JSON CRUD and HTTP/WebSocket servers; use apiconn to consume APIs. - ASGI server required to serve traffic:
expose-apihas zero runtime deps and emits a standard ASGI 3 callable—run it behind an ASGI server (e.g.,uvicornorhypercorn) in development and production. - Dataclass contract changes: Generated CRUD endpoints and OpenAPI 3.1.0 schemas derive directly from your Python
>=3.14dataclass fields; breaking field renames immediately change wire contracts.
Pairs With
- backpack-store & enforce-type — Optional persistence and validation extras.
- compose-application — Composes
expose-apiwithbackpack-storeandspatial-ui.
Metadata
type: project-card
slug: expose-api
org: wispsy
repo: wispsy/expose-api
package: expose-api
version: 0.2.0
requires_python: ">=3.14"
layer: frameworks
topic: wispsy-framework
status: active
language: python
source_docs: README.md, docs/
Linked from
- tuts/third_party/python3/wispsy
- wiki/choosing
- wiki/compatibility
- wiki/families
- wiki/orgs/wispsy
- wiki/principles
- wiki/projects
- wiki/projects/apiconn
- wiki/projects/carets
- wiki/projects/compose-application
- wiki/projects/enforce-type
- wiki/projects/expose-interface
- wiki/projects/gitcx
- wiki/projects/prettynb
- wiki/stack/frameworks
Related notes
- wiki/projects/carets Linked here; links to this page; shared tags: #frameworks, #project, #tier, #wispsy
- wiki/projects/expose-interface Linked here; links to this page; shared tags: #frameworks, #project, #tier, #wispsy
- wiki/projects/apiconn Linked here; links to this page; shared tags: #project, #tier, #wispsy
- wiki/projects/compose-application Linked here; links to this page; shared tags: #project, #tier, #wispsy
- wiki/projects/enforce-type Linked here; links to this page; shared tags: #project, #tier, #wispsy
- wiki/stack/frameworks Linked here; links to this page; shared tags: #frameworks, #tier, #wispsy
- wiki/orgs/wispsy Linked here; links to this page; shared tags: #tier, #wispsy
- wiki/projects Linked here; links to this page; shared tags: #wispsy
- wiki/projects/backpack-store Linked here; shared tags: #project, #tier, #wispsy
- wiki/projects/gitcx links to this page; shared tags: #project, #tier, #wispsy