Skip to main content

Entity-to-Web-API conversion library: Python framework that turns internal configuration, service functions, and entities into production-ready APIs using FastAPI, with minimal boilerplate

Project description

xwapi

Engine-agnostic API framework for the eXonware stack. xwapi exposes xwentity and xwaction as HTTP endpoints, standardizes error contracts, supports production middleware, and now includes a durable action pipeline plus API token lifecycle/metering.

Longer guide: README_LONG.md.

Company: eXonware.com · Author: eXonware Backend Team · Email: connect@exonware.com

Status Python License


Install

Install When to use
pip install exonware-xwapi Core runtime
pip install exonware-xwapi[lazy] Lazy dependency loading
pip install exonware-xwapi[full] Full production dependency set

Quick start

from exonware.xwapi import XWAPI
from exonware.xwentity import XWEntity


class User(XWEntity):
    name: str
    email: str
    age: int


api = XWAPI(entities=[User], title="My API", version="1.0.0")
app = api.create_app(engine="fastapi")

New production features

  • Engine-agnostic error contract: xwapi_error_to_http_parts plus adapters keeps XWAPIError transport-neutral.
  • Outbox + singleton worker pipeline: ActionPipelineManager, AOutboxStore/InMemoryOutboxStore, and BackgroundWorker.
  • API token lifecycle: create/list/revoke tokens, usage tracking, balance/recharge, idempotent metering.
  • Provider abstractions: IAuthProvider, IStorageProvider, IPaymentProvider with in-memory and library adapters.
  • API token middleware: bearer verification, optional scope enforcement, deny-unmapped policy, usage metering via Idempotency-Key.
  • Admin/operations endpoints: server status/health/pipeline controls and token admin endpoints.
  • Production guardrails: environment-based admin token enforcement and admin read-protection support.

eXonware integration

xwapi now explicitly integrates with:

  • xwsystem (serialization, logging/utilities)
  • xwaction (action registration and execution)
  • xwentity (entity-driven API surfaces)
  • xwschema (schema validation/generation integration points)
  • xwdata (data/serialization integration paths)

Docs and tests


Async support

  • Core runtime includes async methods across facade, token manager, middleware paths, and server actions.
  • Async APIs are recommended for I/O-heavy and concurrent workloads.

MIT - see LICENSE. Homepage: https://exonware.com Version: 0.9.0.3 | Updated: 01-Apr-2026

Built with ❤️ by eXonware.com - Revolutionizing Python Development Since 2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exonware_xwapi-0.9.0.3.tar.gz (161.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exonware_xwapi-0.9.0.3-py3-none-any.whl (142.5 kB view details)

Uploaded Python 3

File details

Details for the file exonware_xwapi-0.9.0.3.tar.gz.

File metadata

  • Download URL: exonware_xwapi-0.9.0.3.tar.gz
  • Upload date:
  • Size: 161.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for exonware_xwapi-0.9.0.3.tar.gz
Algorithm Hash digest
SHA256 4669f0eab4c22116d359729fc78a0d10e8cc1fae3b535f42ed32f5e0a48d82fb
MD5 e9d09d09632ed1f729fc8a10c1bb56b0
BLAKE2b-256 a2f29d65a698c17783a3083e5a7d2f8d440f5a8cf3b601ab3288566ea2012f6e

See more details on using hashes here.

File details

Details for the file exonware_xwapi-0.9.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for exonware_xwapi-0.9.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7269802cfca98876ed00b0b2b405e59468df0032b892d90f6fbe50080cf06ef8
MD5 857a4469025f1fcfeb087d88a037e3e0
BLAKE2b-256 b34fe49b811c249182691c536c9d7615f25f98b497cc80e1832974afbe971b26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page