$npx skillfedfor your agent

PyPika

A SQL query builder API for Python

Worth itPyPI Python ModulesReleased Feb 202613.7M downloads / moApache License Version 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pypika-0.51.1-py2.py3-none-any.whl
v0.51.1 · released 2026-02-04 · 1 runtime deps: typing_extensions

Yes. PyPika is a stable, low-friction library with no known vulnerabilities, minimal dependencies, and a permissive license. It's well-suited for projects that need programmatic SQL generation without the overhead of a full ORM. The aging maintenance status (191 days since last release) suggests slower updates, but the stable API and active repository make it reliable for established use cases. Install it if you need to build queries dynamically or support multiple SQL dialects from Python code.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Installation is straightforward with low friction—a pure Python wheel with a single runtime dependency on typing_extensions.
  • The package is in production/stable status and has been actively maintained since 2016, with the latest release on 2026-02-04.

License · maintenance · safety

Apache License Version 2.0 (permissive) — PyPika is licensed under the Apache License Version 2.0, a permissive open-source license that allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects.

last release 2026-02-04 (191 days) · last repo commit 2026-02-04 · 2,925 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 13,706,088 downloads/mo, #1,269 on PyPI

Verify before relying

pip install pypika

from pypika import Query, Table

customers = Table('customers')
q = Query.from_(customers).select(customers.id, customers.fname).where(customers.lname == 'Smith')
print(q.get_sql())
  • Whether the package is actively maintained beyond the 191 days since last release (aging status suggests slower update cadence).
  • Specific database vendor compatibility beyond the keywords listed (MySQL, Postgres, Oracle, Vertica mentioned but not formally tested).
Same gist for agents: .md · .json

What it is and what it does

PyPika is a Python library that lets you build SQL queries programmatically instead of writing raw SQL strings. It uses a fluent builder pattern where you chain method calls to construct SELECT, WHERE, JOIN, GROUP BY, and other SQL clauses. The library is designed for data analysis workflows and aims to replace handwritten SQL or lightweight ORM usage without sacrificing the flexibility of direct SQL control.

The package depends only on typing_extensions and installs as a pure Python wheel, making it easy to add to any project. It supports modern Python versions (3.9+) and has been tested on PyPy3.9 and PyPy3.10. PyPika does not validate SQL correctness—that responsibility falls to you or your database—but it does prevent common mistakes like quote escaping and operator precedence through its API.

Use it for

  • Build dynamic SELECT queries with filters, joins, and aggregations without string concatenation in data pipelines.
  • Generate SQL for multiple database vendors (MySQL, Postgres, Oracle, Vertica) from a single Python codebase.
  • Construct complex WHERE clauses with AND/OR/XOR logic and BETWEEN/IN filters programmatically.
  • Create parameterized queries for analytics dashboards or reporting tools that need runtime-determined column selection.
  • Replace hand-written SQL in legacy codebases to reduce string-formatting bugs and improve readability.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

PyPika is a stable, low-friction library with no known vulnerabilities, minimal dependencies, and a permissive license. It's well-suited for projects that need programmatic SQL generation without the overhead of a full ORM. The aging maintenance status (191 days since last release) suggests slower updates, but the stable API and active repository make it reliable for established use cases. Install it if you need to build queries dynamically or support multiple SQL dialects from Python code.

Install

pypika on PyPI

Before you install

Installation is straightforward with low friction—a pure Python wheel with a single runtime dependency on typing_extensions. The package is in production/stable status and has been actively maintained since 2016, with the latest release on 2026-02-04.

License in practice

PyPika is licensed under the Apache License Version 2.0, a permissive open-source license that allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects.

Quickstart

pip install pypika

from pypika import Query, Table

customers = Table('customers')
q = Query.from_(customers).select(customers.id, customers.fname).where(customers.lname == 'Smith')
print(q.get_sql())

Verify before relying

  • Whether the package is actively maintained beyond the 191 days since last release (aging status suggests slower update cadence).
  • Specific database vendor compatibility beyond the keywords listed (MySQL, Postgres, Oracle, Vertica mentioned but not formally tested).

Package facts

LicenseApache License Version 2.0 permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
typing_extensions
MaintenanceAging 191 days since the last release
Last repo commit
First released
Downloads13,706,088 / month, #1,269 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PL/SQLProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: Libraries :: Python Modules

Evidence: pypika-0.51.1-py2.py3-none-any.whl

Tags

Capabilities
SQL query builder Pythonprogrammatic SQL generationPython database query constructionSQL builder without ORMdynamic query generationSQL abstraction layerquery builder pattern
Topics
query-buildersql-generationdata-analysis
PyPI keywords
pypikapythonquerybuilderquerybuildersqlmysqlpostgrespsqloracleverticaaggregatedrelationaldatabaserdbmsbusinessanalyticsbidatascienceanalysispandasormobjectmapper

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “SQL query builder Python”

  • PyPikaPyPika is a Python API for building SQL queries programmatically…
  • pypika-tortoiseGenerates SQL queries programmatically for Tortoise ORM, providing a…
  • datafusion-query-builderBuilds DataFusion SQL queries programmatically with injection-safe…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also pypika-tortoise · django-query-builder · SQLAlchemy · pypyodbc · sqlmodel · aiosql · datafusion-query-builder · python-sql · django-sql-explorer · sqlvalidator