Comparison
moz-sql-parser vs pglast vs sql-formatter 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-parserPostgreSQL Languages AST and statements prettifier
Actively maintained. Last release 6 days ago, commits in 16 of the last 26 weeks. A safe choice.
pip install pglastA SQL formatter
Likely abandoned. No release or commit for years (last release over 5 years ago).
pip install sql-formatterA non-validating SQL parser.
Maintained. Last release 4 weeks ago, commits in 7 of the last 26 weeks. Weaker on issue handling and contributor spread.
pip install sqlparseIn short
- sql-formatter looks abandoned: avoid it for new projects.
- sqlparse is the most used: 128.9M downloads a month, 11× more than pglast.
- pglast is better maintained: Pythie’s Index 87 against 62.
- pglast is growing fastest: downloads +22% over the last month.
- pglast is the newcomer: first released Jul 2026.
- Safe default for a new project: sqlparse, or pglast if active maintenance matters most.
Side by side
| Metric | moz-sql-parser | pglast | sql-formatter | sqlparse |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 15 | 87 |