Skip to main content

AstraAPI

AstraAPI

FastAPI-compatible. C++ core. Built-in workers. No gunicorn needed.

PyPI License Python C++20


AstraAPI is a drop-in replacement for FastAPI with a compiled C++20 core. Same decorators. Same Pydantic models. Same OpenAPI docs. But 5-10x faster — no external server required.

from astraapi import AstraAPI

app = AstraAPI()

@app.get("/")
def hello():
    return {"message": "Hello World"}

if __name__ == "__main__":
    app.run(port=8000, workers=4)

Output:

C++ HTTP server running on http://127.0.0.1:8000
Press Ctrl+C to stop

Why AstraAPI?

FastAPI + Uvicorn AstraAPI
HTTP parser httptools (Python) llhttp (C++, Node.js)
JSON orjson yyjson + SIMD serializer
Workers gunicorn/uvicorn Built-in fork/spawn
Keep-alive Per-connection timers Batch sweep
Compression zlib libdeflate (2-3x faster)
Throughput ~45k req/s ~236k req/s

Install

pip install astraapi

Python 3.14+

Quick Start

python -m astraapi --help

Or write a file:

from astraapi import AstraAPI
from pydantic import BaseModel

app = AstraAPI()

class Item(BaseModel):
    name: str
    price: float

@app.get("/items/{item_id}")
def read_item(item_id: int, q: str | None = None):
    return {"item_id": item_id, "q": q}

@app.post("/items/")
def create_item(item: Item):
    return item

if __name__ == "__main__":
    app.run(port=8000, workers=4)

Features

  • 100% FastAPI compatible — same @app.get, Depends, BaseModel, Query, Path, File, UploadFile, WebSocket, BackgroundTasks
  • Built-in multi-worker server — SO_REUSEPORT, CPU affinity, auto-restart. No gunicorn.
  • C++ HTTP core — llhttp parser, radix trie router, yyjson, SIMD string escape, ryu float formatting
  • Zero-copy transport — direct send() for small responses, writev() for WebSockets
  • Native middleware — CORS, GZip (libdeflate), TrustedHost, HTTPSRedirect, RateLimiting
  • Real TestClient — starts actual C++ HTTP server on ephemeral port
  • Hot reload — app.run(reload=True) watches files via watchfiles

Documentation

Visit https://astraapi.dev or the docs folder.

License

MIT — see LICENSE.

Made with ⚡ by Lumos Labs HQ

Metadata

Release files for astraapi 0.2.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astraapi 0.2.11
File Size Uploaded
astraapi-0.2.11.tar.gz 3.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for astraapi 0.2.11
File
astraapi-0.2.11-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
astraapi-0.2.11-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
astraapi-0.2.11-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
astraapi-0.2.11-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details

Total release size: 7.1 MB

Release files / astraapi-0.2.11.tar.gz

Download URL astraapi-0.2.11.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
36d85689cab20438b59cb705e3efb6e2b0f5954e7d614ff3b8292dc03bce3419
BLAKE2b-256 checksum
How to use checksums
7ea7448fa02037eac8bac7b81b4e7ba73841cdc03904af316ecdd45a5b9280fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / astraapi-0.2.11-cp314-cp314-win_amd64.whl

Download URL astraapi-0.2.11-cp314-cp314-win_amd64.whl
Size 514.5 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
3461686ecf471e8c52fb548eef2ec10d71023e9a849b9a5494dfbe1bfa3b700f
BLAKE2b-256 checksum
How to use checksums
ef7726252251ec4802f34c3e4146b9107530de77c8ea587885cb6ca47ab9f890
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / astraapi-0.2.11-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL astraapi-0.2.11-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8c461f0a9682e15d839a6708292a883381647ba0830f73af25fe08dea2f20f71
BLAKE2b-256 checksum
How to use checksums
a03f53c0f5de6c8b44bbd661fb117942914e2c57e173ed8eb5b67a97e47fb3fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / astraapi-0.2.11-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL astraapi-0.2.11-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 1.3 MB
Tags CPython 3.14 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
db2f52fbc131310886e19bb96b26d52b0fa0914cdae0c4b6bda12fa490b4fe23
BLAKE2b-256 checksum
How to use checksums
a7e0d6c3e338814f1f529a9d55db77b9bc30d4bdb68df0c5b6c850df903005e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / astraapi-0.2.11-cp314-cp314-macosx_14_0_arm64.whl

Download URL astraapi-0.2.11-cp314-cp314-macosx_14_0_arm64.whl
Size 944.3 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d379312ea68eccfdb15725e61af23802f239f31d6eabbaa11ac3f72ce6ae7723
BLAKE2b-256 checksum
How to use checksums
b5bc2d7ae20cd1adffb19fa2e2ea57cc3a211fc11dbb0034a19c64c8dbb963be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.2.11 This release

5 release files

0.2.3

5 release files

0.2.1

5 release files

0.2.0

13 release files

0.1.13

9 release files

0.1.0

9 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page