business

Verdict

Submitted 5/28/2026, 2:28:16 PM · Completed 5/28/2026, 2:29:46 PM

5.5
pivot
The idea

Show HN: Py-SQL-cleaner – format SQL embedded in Python strings

Show original source text →
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.
TRIZ inventive level: 3/5· Principles: parameter changes
Synthesis verdict
**Pivot**: The idea of py-sql-cleaner, a CLI for formatting SQL embedded in Python files, has a clear problem-solution fit and addresses a specific pain point in Python development. However, its market size is constrained, and monetization potential is weak due to the niche nature of the tool and the lack of a clear revenue model. The tool's focus on detecting and formatting only the SQL within Python files, while avoiding dynamic SQL elements, demonstrates a clear understanding of the problem's scope. However, the estimated addressable market is small, and the willingness to pay for such a tool is questionable.

Strengths

  • Clear problem-solution fit
  • Technically manageable for a small team
  • Focused tool with a clear scope
  • Differentiation from broader formatters
  • Potential for expansion to support more template languages

Weaknesses

  • Constrained market size due to ORM adoption and parameterized queries
  • Weak monetization potential due to niche nature and lack of clear revenue model
  • Limited broad appeal and potential for churn
  • Platform risk from dependency on Python and SQL evolution
  • No clear call-to-action for paid tiers or channel strategy

Best angle

To succeed, py-sql-cleaner should expand its scope to support more template languages, integrate with popular Python formatters, and develop a clear revenue model, such as a freemium or enterprise offering with added value features.

Panel verdicts

Competition

nvidia/nemotron-3-nano-omni-30b-a3b-reasoning

8.0

A focused CLI that cleans only embedded SQL in Python files fills a gap left by generic SQL formatters and generic code formatters.

The market for SQL formatting tools already includes generic solutions such as sqlparse, SQLFluff, and IDE‑integrated formatters (e.g., DataGrip, VS Code extensions) that operate on standalone .sql files or raw SQL text. None of these specifically target SQL fragments embedded within Python source code, nor do they deliberately ignore parameterized or templated SQL, which are common in Python projects. py-sql-cleaner therefore occupies a narrow niche: it detects and formats only the SQL blocks inside .py files, preserving the surrounding Python syntax and avoiding rewrites of dynamic parts. This focus differentiates it from broader formatters that either miss embedded SQL entirely or attempt to parse the whole file, which can lead to errors or unnecessary changes. The durability of this differentiation hinges on the continued prevalence of inline SQL in Python codebases, which remains true for many data‑engineering and scripting workflows. If the niche grows, the tool can expand (e.g., support more template languages) while maintaining its core advantage of zero‑impact, in‑place formatting. Competitors lack this precise scope, so the entrant enjoys a defensible, low‑competition space, though market size is limited and adoption will depend on awareness and integration with existing Python tooling chains.

Risk

nvidia/llama-3.3-nemotron-super-49b-v1

3.0

Niche utility with limited broad appeal vulnerable to churn and platform risks.

The idea's niche focus on formatting SQL within Python files, while solving a specific pain point, faces significant challenges due to its limited appeal, potential integration complexities with existing workflows, and the ease with which the solution could be replicated or overlooked in favor of manual handling or broader formatting tools. Specifically, **churn due to lack of broad utility** (users might not see enough value for regular use), **platform risk from dependency on Python and SQL evolution** (changes in Python or SQL standards could break the tool), and **no-budget customers** (developers might not pay for a niche tool when manual workarounds exist) threaten its viability within 6-12 months. The tool's ability to avoid dynamic SQL is a plus, but the market might be too small to sustain the project without broader application or integration into popular Python formatters.

Monetization

mistralai/mistral-medium-3.5-128b

3.0

Niche developer tools need a compelling paid value-add or enterprise angle to monetize, which this lacks.

The idea addresses a niche pain point (formatting embedded SQL in Python files) but lacks a clear monetization path. The tool is open-source (implied by CLI distribution via `uvx`), which is great for adoption but poor for revenue unless a dual-license or premium model is introduced. Potential revenue streams are weak: (1) **Freemium**: Hard to justify paid features (e.g., advanced formatting rules) for a developer tool with low willingness-to-pay. (2) **Enterprise**: Selling to teams would require significant added value (e.g., IDE plugins, CI/CD integrations, compliance checks) beyond the current scope. (3) **Sponsorships**: Possible but unreliable for sustained revenue. Unit economics are unfavorable—support costs for a free CLI tool could outweigh donations or sponsorships. The conversion path is undefined; there’s no pricing, no call-to-action for paid tiers, and no channel strategy (e.g., GitHub Sponsors, marketplace listings). Without a concrete revenue model (e.g., $10/month per developer for a Pro version with team features), the venture’s monetization potential is minimal.

Viability

nvidia/llama-3.3-nemotron-super-49b-v1(fallback #1)

8.0

A focused tool with a clear problem-solution fit, technically manageable for a small team given the right libraries and experience.

py-sql-cleaner addresses a specific, identifiable pain point in Python development where SQL embedded in Python files lacks dedicated formatting tools. The tool's focus on detecting and formatting only the SQL within Python files, while avoiding dynamic SQL elements, demonstrates a clear understanding of the problem's scope. Technical complexity is moderate due to the need for parsing Python files to identify SQL snippets, which can be challenging especially with varied formatting and potential for false positives. However, leveraging existing Python parsing libraries (e.g., ast, tokenize) and SQL formatting libraries (e.g., sqlparse) can significantly reduce development complexity. The feature set is lean, focusing on listing, formatting in-place, and extraction, which aids in a quicker development cycle. A solo or 2-person team could realistically build v1 in 4-12 weeks, assuming prior experience with Python development and parsing techniques. Challenges include accurately identifying all SQL patterns without false positives and handling edge cases in SQL syntax within Python strings. Ease comes from the targeted scope and the availability of libraries to offload heavy lifting in parsing and formatting.

Market

moonshotai/kimi-k2.6(fallback #1)

6.0

A real and relatable developer pain point, but the addressable market is constrained by ORM adoption, the tool's own limitations with parameterized queries, and weak monetization potential for a narrow CLI utility.

The target audience is well-defined but narrow: Python developers working with embedded SQL, typically in data engineering, backend development, or analytics. This is a real pain point—SQL strings in Python are common (ORMs, raw queries in Django/Flask/FastAPI, data pipelines), and existing tools don't handle this boundary well. The 'uvx' distribution suggests modern Python packaging awareness, lowering friction. However, several concerns limit market size: (1) Many Python developers already use ORMs (SQLAlchemy, Django ORM) that reduce raw SQL needs; (2) Those with heavy SQL often use dedicated .sql files or dbt, which this tool doesn't compete with; (3) The 'skip templated SQL' default, while technically sound, means the tool fails on a significant portion of real-world embedded SQL—parameterized queries are extremely common; (4) The extraction to .sql file is useful but overlaps with IDE refactoring tools. Willingness to pay is questionable: this feels like a developer productivity tool that would struggle to command premium pricing. Open-source CLI tools in this space typically monetize through sponsorship or freemium, not direct sales. The HN launch strategy is appropriate for developer tools but doesn't guarantee commercial viability. Estimated addressable market: tens of thousands of developers globally, but conversion to revenue is uncertain. The tool solves a genuine friction point, but it's a feature-sized problem, not a platform.

Synthesized by meta/llama-3.3-70b-instruct · 20.3s