Comparison
moz-sql-parser vs pgparse vs postgast vs sqlparse
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Extract Parse Tree from SQL
Low maintenance activity. Last release over 5 years ago, commits in 1 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install moz-sql-parserPython wrapper for libpg_query
Low maintenance activity. Last release 8 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install pgparsePython bindings to libpg_query: parse, deparse, normalize, fingerprint, split, and scan PostgreSQL SQL
Maintained. Last release 2 months ago, commits in 6 of the last 26 weeks. Weaker on contributor spread.
pip install postgastA non-validating SQL parser.
Actively maintained. Last release 4 weeks ago, commits in 8 of the last 26 weeks. A safe choice.
pip install sqlparseIn short
- sqlparse is the most used: 129.5M downloads a month, 259× more than pgparse.
- Maintenance is comparable: sqlparse 70, postgast 65, pgparse 35, moz-sql-parser 15 on Pythie’s Index.
- postgast is growing fastest: downloads +414% over the last month.
- postgast is the newcomer: first released Feb 2026.
- Safe default for a new project: sqlparse.
Side by side
| Metric | moz-sql-parser | pgparse | postgast | sqlparse |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 15 | 35 |