Nicheloom

Market intelligence for builders — see what's gaining traction before it's crowded.

Py-SQL-cleaner

format SQL embedded in Python strings

Details

External ID
48312436
Source
HN
Company
—
Product
Py-SQL-cleaner
Website domain
github.com
Launched
May 28, 2026
Cohort
—
Upvotes
7
Upvotes percentile
0.4168012924071082
Tags
—
Fetched at
Sept. 7, 2026, 9:26 p.m.
Updated at
Sept. 7, 2026, 9:26 p.m.

Description

Hi HN, I built py-sql-cleaner, a CLI for formatting SQL embedded in Python files.Python formatters handle Python syntax. They do not format SQL written inside Python code. On the other hand, SQL formatters usually target SQL files or raw SQL text, not SQL embedded inside a Python file.Still, I think it is not uncommon to find long SQL queries inside Python codebases.py-sql-cleaner detects embedded SQL inside Python files and works only on that SQL. The main things it can do are: find the SQL, format it in place, or extract it into a .sql file.It avoids rewriting SQL that depends on runtime values or template expansion. For example, SQL containing parameters like %s or :name, or Jinja-style template variables like {{ ds }}, is skipped by default.Try it with: uvx py-sql-cleaner list path/to/file.py uvx py-sql-cleaner format path/to/file.py --dry-run If you write Python, have run into this kind of SQL cleanup problem, or are just curious, I’d be happy if you take a look.

Enrichment

Theme
spreadsheet and tabular data tools
Vertical
Horizontal
Function
Dev tools
Audience
Developer
AI stance
Not AI
Project type
Hobby / open-source project
Normalized one-liner
sql formatter for python strings
Manually corrected
False

Could you build this?

Yes It is a focused CLI utility that parses Python code (likely via python's `ast` module or tree-sitter) to find SQL string literals and pass them to an existing SQL formatter library.

Discussion

No comments on this launch.

Competitors

Other products that read as similar to this one — 87 launches clear the similarity bar, closest 8 shown.

Attention rank: #40 of 88 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).

Launched 209 days after the earliest competitor.

Other launches for this product

Same idea, different domain

Nobody's really built a dev tools tool for Sales yet.