skillfed

piccolo-api

Utilities for using the Piccolo ORM in ASGI apps, plus essential ASGI middleware such as authentication and rate limiting.

piccolo-api v1.11.0 583.5K downloads/30d#5,892 on PyPI161
Permissive license MIT Active released

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-api

uv

uv add piccolo-api

poetry

poetry add piccolo-api

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPython

Tags

piccolo orm rest apiasgi middleware authenticationfastapi database endpointsrate limiting csrf middlewarerest api from database tables
orm-integrationrest-api-generatorasgi-middleware

More Dynamic Content packages