format-sql is a tool to format SQL in your Python strings!
Project description
Copyright (c) 2014, Friedrich Paetzke (f.paetzke@gmail.com) All rights reserved.
format-sql is a tool to format SQL in your Python strings!
Install format-sql via pip:
$ pip install format-sql
You can then just call format-sql with files and directories:
$ format-sql my_python_file.py my/python/dir/
An example:
sql = """
select *
from my_table as mt join ma_table as ta on ma.id = k.id
where idt=4 and ih in ('syds', 'sdsd');
"""
Will result in:
sql = """
SELECT
*
FROM
my_table AS mt
JOIN ma_table AS ta ON ma.id = k.id
WHERE
idt=4
AND ih IN ('syds', 'sdsd'); """
This is an early version and work in progress. Don’t expect too much right now.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
format-sql-0.0.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for format_sql-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c358ce6275b90fc0276610cf98e3ad5429c2702eebe0f87a359b14d6f0f2722 |
|
MD5 | 123198f1151cdfbab634098d41fb2697 |
|
BLAKE2b-256 | 9eacaecea1f62641f59b74fa898ed67fa1668af073a5d03dada6e68d4c64cd27 |