piccolo-api
Utilities for using the Piccolo ORM in ASGI apps, plus essential ASGI middleware such as authentication and rate limiting.
What it is and what it does
Piccolo API bridges Piccolo ORM tables and ASGI web frameworks like FastAPI and Starlette, automatically generating REST endpoints from your database schema. It eliminates boilerplate by letting you define a table in Piccolo and immediately expose it as a queryable API, with built-in support for filtering, pagination, and standard CRUD operations.
Beyond endpoint generation, the package includes a suite of production-ready ASGI middleware: session and token authentication, rate limiting, CSRF protection, and Content Security Policy headers. It also integrates tightly with Pydantic, allowing you to derive validation schemas directly from your Piccolo table definitions. The library targets modern Python versions and is actively maintained.
Use it for:
- Quickly prototype a REST API backed by a Piccolo database without writing individual route handlers.
- Add authentication and rate limiting to an existing FastAPI or Starlette application via drop-in middleware.
- Generate Pydantic models from Piccolo tables to standardize request/response validation.
- Build a data admin interface or internal tool that exposes database tables as queryable endpoints.
- Secure an ASGI application with CSRF and CSP headers using pre-built middleware components.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Exposes Piccolo ORM tables as REST endpoints in ASGI applications and provides essential middleware for authentication, rate limiting, CSRF protection, and content security.
Yes. The package is actively maintained, has no known vulnerabilities, installs cleanly, and solves a real problem—automating REST endpoint generation from Piccolo tables while providing essential middleware. It's a good fit if you're building with FastAPI or Starlette and Piccolo ORM. The MIT license poses no restrictions.
Install
piccolo-api on PyPI
pip
pip install piccolo-apiuv
uv add piccolo-apipoetry
poetry add piccolo-apiInstalling piccolo-api
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a release within the last week. Requires Python 3.10 or later and depends on FastAPI, Piccolo, Pydantic, and related web libraries.
License in practice
MIT license is permissive; you can use this package in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install piccolo-api
from piccolo_api.rest import create_tables
from fastapi import FastAPI
app = FastAPI()
# Mount Piccolo table endpoints via create_tables or REST routing
Requires Python 3.10 or later and a working Piccolo ORM setup with database configuration.
Verify before relying
- Exact API surface and endpoint generation behavior for different table schemas.
- Performance characteristics under high concurrency or large result sets.
- Compatibility matrix with specific Piccolo and FastAPI versions beyond the stated Python support.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — Jinja2, piccolo, pydantic, python-multipart, fastapi, PyJWT, httpx |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 583,488/month — #5,892 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: piccolo_api-1.11.0-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
piccoloPiccolo is an async-first ORM and query builder…
permissive · top 15,000 on PyPI
piccolo-adminPiccolo Admin is a web-based admin interface…
permissive · top 15,000 on PyPI
asgi-csrfASGI middleware that protects web applications…
permissive · top 15,000 on PyPI
slowapiAdds rate limiting to Starlette and FastAPI…
permissive · top 1,000 on PyPI
starlette-csrfStarlette middleware that protects web…
permissive · top 15,000 on PyPI
asgi-ratelimitAn ASGI middleware that enforces rate limits on…
permissive · top 15,000 on PyPI
litestarLitestar is an ASGI framework for building REST…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-asgiProvides ASGI middleware for OpenTelemetry that…
permissive · top 1,000 on PyPI
fastapi-csrf-protectAdds stateless CSRF protection to FastAPI…
permissive · top 15,000 on PyPI
secureApplies HTTP security headers to Python web…
permissive · top 5,000 on PyPI