All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

py-sql-cleaner: A CLI tool for finding, formatting, and extracting embedded SQL from Python codebases

By

enumura

3d ago· 3 min readenCode

Summary

py-sql-cleaner is an early-stage CLI tool (MVP) designed to find, format, and extract SQL queries embedded within Python files. It targets codebases where SQL is written inside triple-quoted Python strings. The tool uses SQLGlot for formatting, supports database-specific dialects via a --dialect flag, and can either format SQL in place or extract it into external .sql files. It does not connect to databases.

Key quotes

· 4 pulled
py-sql-cleaner is a CLI tool for finding, formatting, and extracting SQL embedded in Python files.
It is built for Python codebases where long SQL queries are written directly inside triple-quoted Python strings.
py-sql-cleaner can format that SQL in place, or extract it into an external .sql file.
It uses SQLGlot internally for best-effort SQL formatting. It does not connect
Snippet from the RSS feed
Find, format, and safely extract embedded SQL from Python files. - enumura1/py-sql-cleaner

You might also wanna read