WellAPI
WellAPI is a lightweight web framework for building APIs on AWS Lambda and API Gateway.
Documentation
- Practical usage guide:
docs/framework-usage.md
Features
- Lambda-first route definitions (
GET,POST,PUT,PATCH,DELETE) - Type-based request parsing and validation with Pydantic
- Dependency injection via
Depends - Middleware and custom exception handlers
- OpenAPI generation compatible with API Gateway integrations
- SQS handlers and scheduled job handlers
- Packaging helpers for Lambda app code and dependency layers
Installation
Install the base package:
pip install wellapi
Install with optional extras:
pip install "wellapi[local,deploy,telemetry]"
local: local server/test toolingdeploy: AWS CDK integrationtelemetry: native OpenTelemetry support (traces, metrics, logs) — see docs/telemetry.md
Quick Start
main.py:
from wellapi import WellApi
app = WellApi(title="My API", version="1.0.0")
@app.get("/hello")
def hello():
return {"message": "Hello, World!"}
Create a handlers/ directory for additional endpoints if needed:
handlers/
__init__.py
users.py
Local Development
Run with Uvicorn:
uvicorn main:app --reload
If your handlers are not in the default handlers/ directory, configure it in pyproject.toml:
[wellapi]
handlers_dir = "your_handlers_dir"
CLI
Generate OpenAPI:
wellapi openapi main:app handlers --output openapi.json
Enable CORS in OpenAPI output:
wellapi openapi main:app handlers --output openapi.json --cors true --role_name WellApiRole
Build deployment artifacts:
wellapi build app app.zip
wellapi build dep deps.zip
Deploy with AWS CDK
from aws_cdk import Stack
from constructs import Construct
from wellapi.build.cdk import WellApiCDK
class MyStack(Stack):
def __init__(self, scope: Construct, id_: str, **kwargs) -> None:
super().__init__(scope, id_, **kwargs)
WellApiCDK(
self,
"WellApiCDK",
app_srt="main:app",
handlers_dir="handlers",
cors=True,
cache_enable=False,
log_enable=True,
)
Notes
- API Gateway cache support applies to
GETendpoints. - For full framework usage (routing, DI, middleware, SQS/jobs, testing), see
docs/framework-usage.md.
Metadata
Release files for wellapi 0.12.0
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 |
|---|---|---|---|---|
| wellapi-0.12.0.tar.gz | 114.6 kB | Without provenance | Details for wellapi-0.12.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wellapi-0.12.0-py3-none-any.whl | Python 3 | none | any | Details for wellapi-0.12.0-py3-none-any.whl |
Total release size: 183.6 kB
Release files / wellapi-0.12.0.tar.gz
| Download URL | wellapi-0.12.0.tar.gz |
|---|---|
| Size | 114.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca88a2f7e1144f523ef32cd7fea20e61632a6c8ca13f0cdfc116c19b4425d754
|
|
BLAKE2b-256 checksum How to use checksums |
eb93c95e353ff761091b5d534b720d7ea9e935d9d3a82efe48caaa44c60f1056
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.14
|
Release files / wellapi-0.12.0-py3-none-any.whl
| Download URL | wellapi-0.12.0-py3-none-any.whl |
|---|---|
| Size | 69.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b02b38ea3487c373aab1828dbd11757977fc7e13a1eca9bd4f4a6963fc15bbf
|
|
BLAKE2b-256 checksum How to use checksums |
42b1eb7a85c99e2d5227dd07c2a524288a66a9295167eba5b10848af1695acbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.14
|
Security for wellapi 0.12.0
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.