--- id: pypika-tortoise version: "0.6.5" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pypika-tortoise — Forked from pypika and streamline just for tortoise-orm License: permissive · Maintenance: active · Downloads: 586.9K/mo ## 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 above — 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 pip install pypika-tortoise uv add pypika-tortoise poetry add pypika-tortoise ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 586.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tortoise orm sql builder, python sql query generation, orm query builder, sql construction library, tortoise database queries, programmatic sql generation, orm query abstraction, sql-builder, orm-integration [View on SkillFed](https://skillfed.io/packages/pypika-tortoise) · [View on PyPI](https://pypi.org/project/pypika-tortoise/)