Metadata-Version: 2.4
Name: exonware-xwapi
Version: 0.9.0.3
Summary: 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-URL: Homepage, https://exonware.com
Project-URL: Repository, https://github.com/exonware/xwapi
Project-URL: Documentation, https://github.com/exonware/xwapi#readme
Project-URL: Subtree, https://github.com/exonware/xwapi.git
Author-email: eXonware Backend Team <connect@exonware.com>
License: MIT
License-File: LICENSE
Keywords: api,exonware,fastapi,graphql,oauth2,openapi,rest
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: exonware-xwaction
Requires-Dist: exonware-xwdata
Requires-Dist: exonware-xwentity
Requires-Dist: exonware-xwschema
Requires-Dist: exonware-xwsystem
Requires-Dist: fastapi>=0.104.0
Requires-Dist: requests>=2.31.0
Requires-Dist: uvicorn[standard]>=0.24.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: exonware-xwlazy; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Provides-Extra: full
Requires-Dist: a2wsgi; extra == 'full'
Requires-Dist: aiodns; extra == 'full'
Requires-Dist: aiohttp; extra == 'full'
Requires-Dist: atomicwrites; extra == 'full'
Requires-Dist: attrs; extra == 'full'
Requires-Dist: bottleneck; extra == 'full'
Requires-Dist: brotli; extra == 'full'
Requires-Dist: brotlicffi; extra == 'full'
Requires-Dist: cachebox; extra == 'full'
Requires-Dist: cachetools; extra == 'full'
Requires-Dist: cbor2; extra == 'full'
Requires-Dist: chardet; extra == 'full'
Requires-Dist: cloudpickle; extra == 'full'
Requires-Dist: cython; extra == 'full'
Requires-Dist: dicttoxml; extra == 'full'
Requires-Dist: httpx; extra == 'full'
Requires-Dist: hyperlight-hyperjson; extra == 'full'
Requires-Dist: interegular; extra == 'full'
Requires-Dist: json5; extra == 'full'
Requires-Dist: lark; extra == 'full'
Requires-Dist: lz4; extra == 'full'
Requires-Dist: msgpack; extra == 'full'
Requires-Dist: msgspec; extra == 'full'
Requires-Dist: numexpr; extra == 'full'
Requires-Dist: numpy; extra == 'full'
Requires-Dist: orjson; extra == 'full'
Requires-Dist: pandas; extra == 'full'
Requires-Dist: pyarrow; extra == 'full'
Requires-Dist: pyjwt; extra == 'full'
Requires-Dist: pylru; extra == 'full'
Requires-Dist: pymongo; extra == 'full'
Requires-Dist: python-multipart; extra == 'full'
Requires-Dist: pytz; extra == 'full'
Requires-Dist: regex; extra == 'full'
Requires-Dist: rich; extra == 'full'
Requires-Dist: scikit-learn; extra == 'full'
Requires-Dist: simplejson; extra == 'full'
Requires-Dist: socks; extra == 'full'
Requires-Dist: tomli; extra == 'full'
Requires-Dist: tomli-w; extra == 'full'
Requires-Dist: uarray; extra == 'full'
Requires-Dist: xmltodict; extra == 'full'
Requires-Dist: zstandard; extra == 'full'
Provides-Extra: lazy
Requires-Dist: exonware-xwlazy; extra == 'lazy'
Requires-Dist: exonware-xwsystem[lazy]; extra == 'lazy'
Provides-Extra: storage
Requires-Dist: exonware-xwstorage; extra == 'storage'
Description-Content-Type: text/markdown

# 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](README_LONG.md).*

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

[![Status](https://img.shields.io/badge/status-beta-blue.svg)](https://exonware.com)
[![Python](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://www.python.org)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](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

```python
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

- Start at [docs/INDEX.md](docs/INDEX.md).
- API and architecture references: [docs/REF_15_API.md](docs/REF_15_API.md), [docs/REF_13_ARCH.md](docs/REF_13_ARCH.md).
- Test layers: `0.core`, `1.unit`, `2.integration`, `3.advance`.
- Full run: `python tests/runner.py`

---

## 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](LICENSE). Homepage: https://exonware.com
Version: 0.9.0.3 | Updated: 01-Apr-2026

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