# kayak/pypika

PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.

Repository: https://github.com/kayak/pypika
Canonical: https://ross.abutalabs.com/products/pypika
Homepage: http://pypika.readthedocs.io/en/latest/
Language: Python
License: Apache-2.0
License Family: permissive
Topics: sql, functional, python, python3, builder, pythonic, query, data
Last push: 2026-02-04T11:27:09+00:00

## Health v2 (maintenance only)
Score: 73/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 65, release rhythm 69, longevity 100
- inputs: {"age_days": 3710, "days_push": 210, "days_rel": 210, "gap_med": 10.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2927, forks 333 (observed 2026-08-28T04:07:30.451052+00:00)

## What it is
PyPika is a Python SQL query builder library that exposes the full richness of SQL through a builder-pattern API mirroring the resulting query syntax. It is designed for data analysis, avoiding string concatenation while remaining extensible to vendor-specific SQL dialects.

## Use cases
- build sql queries in python without string concatenation
- programmatically generate select insert update and delete statements
- write analytics queries against relational databases
- generate vendor-specific sql for mysql postgres oracle vertica
- replace handwritten sql in data pipelines
- compose complex queries with joins and aggregations in python

## When to choose
- you need programmatic sql generation with full sql expressiveness
- you want a lightweight alternative to a full orm
- you are building data analysis or BI tooling in python
- you need to target multiple sql database dialects

## When to avoid
- you want automatic schema validation or type-safe queries
- you need a full orm with models, migrations, and relationship management
- you prefer writing raw sql directly

## Facets
- artifact type: library
- maturity: stable
- function: database, orm, serialization
- domain: databases, data-science, analytics, developer-tools
- platform: python
- tags: sql-query-builder, query-builder, sql-generation, data-analysis, pandas

## Member repositories
- kayak/pypika (main) score 73

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:30.451052+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:33:35.848598+00:00, confidence not recorded.
  - readme: https://github.com/kayak/pypika (fetched 2026-08-28T04:07:30.451052+00:00, sha 6e86e6184356)
  - registry_pypi: https://pypi.org/pypi/pypika/json (fetched 2026-08-29T09:49:16.747821+00:00, sha f6c962e92ac7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
