andialbrecht/sqlparse

A non-validating SQL parser module for Python

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 1 hour ago
Added to GitGenius on September 17th, 2026
Created on April 18th, 2012
Open Issues & Pull Requests: 297 (+0)
GitHub issues: Enabled
Number of forks: 746
Total Stargazers: 4,017 (+0)
Total Subscribers: 87 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 5.5 days
Mean response time: 376.9 days
90th percentile: 1124.8 days
Tracked items: 28

Most active contributors

Sign in to see contributor activity.

How this project is maintained

100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Three people close 100% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 24
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 708 days
Stale 30+ days: 20
Stale 90+ days: 20

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • Bug (3)
  • Enhancement (1)
  • Formatter (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

sqlparse is a non-validating SQL parser module for Python that tokenizes and formats SQL statements without requiring the input to conform to any particular SQL dialect or standard.

The tool addresses the need to programmatically analyze and reformat SQL code in Python applications. Rather than validating SQL against a specific database engine or standard, sqlparse takes a lenient approach: it breaks SQL into tokens and provides utilities to traverse, analyze, and reconstruct the statement. This makes it suitable for scenarios where you need to manipulate SQL strings without enforcing strict correctness, such as log analysis, query rewriting, or preparing statements for display.

The project suits developers who need lightweight SQL processing without heavyweight dependencies or database-specific validation. It works well for formatting, pretty-printing, and basic structural analysis of SQL queries. Because it does not validate against a particular SQL dialect, it can handle a wide variety of SQL flavors and non-standard extensions without failing. This flexibility comes at the cost of not catching syntax errors; if your use case requires validation, you would need to pair this tool with database-specific parsing or validation logic elsewhere.

Development activity shows consistent maintenance with regular commits addressing bug fixes and incremental improvements. The project accepts pull requests and responds to issues, indicating active engagement with users. Work spans both core parsing logic and formatter enhancements, suggesting the maintainer prioritizes both the foundation and practical usability of the tool.