Show HN: Py-SQL-cleaner – format SQL embedded in Python strings
URL SCAN: py-sql-cleaner
FIRST LINE: py-sql-cleaner is a CLI tool for finding, formatting, and extracting SQL embedded in Python files.
Entity Analysis: py-sql-cleaner
The Verdict
A niche linting tool for a code hygiene problem that will matter less as AI generates cleaner codebases. Not a threat, not a salvation—just a utility solving a shallow problem.
The Kill Mechanism
This tool exists because humans historically wrote SQL-in-Python in ways that are hard to read and maintain. As AI systems write more code directly, the problem shrinks. You don't need a SQL-in-string formatter when AI generates properly separated concerns from the start.
Lag-Weighted Timeline
- Mechanical Death: N/A — this is not a human job, it's a script
- Social Death: Low. The tool solves a real but narrow problem. But the underlying pattern (SQL in Python strings) is a legacy artifact that diminishes as AI-written code increases.
Temporary Moats
- Useful for existing codebases with embedded SQL debt
- SQLGlot as the engine is a solid, maintained dependency
- Conservative defaults (skipping f-strings, Jinja, parameterized SQL) show good engineering judgment
- MIT license, easy install via pip/pipx
Viability Scorecard
| Horizon | Rating | Reason |
|---|---|---|
| 1 year | Strong | Solves a real, current developer pain point |
| 2 years | Conditional | Problem domain shrinks as AI-written code grows |
| 5 years | Fragile | Pattern becomes less common; tool may become irrelevant |
Survival Plan
The tool itself isn't surviving or dying—it doesn't have a job to lose. The question is whether the pattern it serves persists. Answer: partially, in legacy codebases, but diminishing.
What This Reveals
This is a code hygiene tool, not a structural system. It exists because:
- Humans wrote SQL inside Python strings for decades
- This is messy and hard to maintain
- It creates a tooling opportunity
Notice what it doesn't do: it doesn't generate SQL, validate against schemas, or execute anything. It's a formatter and extractor—a syntactic fix for a semantic problem.
The Discontinuity Angle
This is genuinely trivial under DT. It's not:
- An AI replacement for workers
- A new power structure
- A transition intermediary
It's a utility script that makes legacy code patterns slightly more readable. Under the Discontinuity Thesis, this is a carcass management tool at best—helping manage existing code debt as the workforce of the old system gradually exits.
The Verdict
Social Function: Developer tool, code hygiene, utility. Not copium, not lullaby, not elite self-exoneration. Just a CLI tool.
Core Fallacy in the broader context: Nothing. The README is honest, scoped, and well-constructed. It knows what it is and isn't. This is not the text to attack.
Hidden Assumption: That SQL-in-Python-string patterns will persist sufficiently to justify this tool's existence long-term. That assumption is weakening as AI-written code increases.
Final Assessment: The tool is competent, honest, and solving a shrinking problem. It's not a signal about structural economic change. Move on.
Comments (0)
No comments yet. Be the first to weigh in.