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.2 | 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.2.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.2-py3-none-any.whl (142.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: exonware_xwapi-0.9.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 918aed0ba56df92556983cb746499045dec9009c39030b3b5e6e4757d3beeae3
MD5 14fde00648fe359653899737bc2902d4
BLAKE2b-256 483bb3888624031a3e76f6a96d92e702a119deb88eae57f17307f8ee5664baee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for exonware_xwapi-0.9.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b5c5513cd2968342d7f8604f2248c54c0f7d35a769705f56ec719dbe6543de8
MD5 0240d84d000dadab8015beb3d59746a6
BLAKE2b-256 3d2b751e4ff2db13c6d3046ea0e39c54e15f5a10e1e2d3ac8eff7288d3692349

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