pypika-tortoise
Forked from pypika and streamline just for tortoise-orm
What it is and what it does
pypika-tortoise is a fork of the pypika SQL query builder, stripped down and adapted specifically for Tortoise ORM. It removes database support and features that Tortoise doesn't use, focusing instead on generating SQL queries efficiently for the ORM's particular use cases. The package exposes a programmatic interface to construct SQL queries—SELECT, WHERE, JOIN, and other clauses—using Python syntax that mirrors the structure of the resulting SQL.
It serves as the query-building layer for Tortoise ORM applications, allowing developers to construct database queries in code rather than writing raw SQL strings. With no external runtime dependencies and support for current Python versions, it integrates cleanly into Tortoise-based projects.
Use it for:
- Building dynamic SELECT queries programmatically within Tortoise ORM models and migrations
- Constructing complex WHERE clauses and joins without writing raw SQL strings
- Generating parameterized queries to prevent SQL injection in Tortoise applications
- Simplifying query construction in data access layers that use Tortoise ORM
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates SQL queries programmatically for Tortoise ORM, providing a streamlined SQL builder tailored to that ORM's specific needs.
Yes, if you use Tortoise ORM. It's the query builder Tortoise depends on, actively maintained, has no external dependencies, and carries permissive licensing. Install it as part of your Tortoise setup rather than as a standalone choice.
Install
pypika-tortoise on PyPI
pip
pip install pypika-tortoiseuv
uv add pypika-tortoisepoetry
poetry add pypika-tortoiseInstalling pypika-tortoise
Before you install
Low install friction with no runtime dependencies. Actively maintained as of March 2026 with recent commits, though the repository has modest visibility (10 stars).
License in practice
Licensed under Apache-2.0, a permissive license that allows commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install pypika-tortoise
from pypika_tortoise import Query, Table
users = Table('users')
q = Query.from_(users).select(users.id, users.name).where(users.active == True)
Requires Python 3.9 or later.
Verify before relying
- Whether this fork diverges significantly enough from pypika to warrant separate maintenance long-term
- Performance improvements claimed in the description—no benchmarks provided in the fact sheet
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 154 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 586,908/month — #5,879 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pypika_tortoise-0.6.5-py3-none-any.whl
Keywords: postgresql, Tortoise-ORM, mysql, sqlite, sql
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
PyPikaPyPika is a Python API for building SQL queries…
permissive · top 5,000 on PyPI
tortoise-ormTortoise ORM is an async-native…
permissive · top 15,000 on PyPI
aerichAerich is a database migration tool for…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-tortoiseormAdds distributed tracing to Tortoise ORM…
permissive · top 5,000 on PyPI
SQLAlchemySQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
django-query-builderBuilds and executes complex SQL queries…
permissive · top 15,000 on PyPI
async-factory-boyExtends factory_boy to generate test fixtures…
permissive · top 15,000 on PyPI
peeweePeewee is a lightweight ORM that maps Python…
unclear · top 1,000 on PyPI
jinjasql2Generates parameterized SQL queries from Jinja2…
permissive · top 15,000 on PyPI
sqlalchemy-trinoProvides a SQLAlchemy dialect for connecting to…
permissive · top 15,000 on PyPI