Skip to main content

format-sql is a tool to format SQL in your Python strings!

Project description

https://travis-ci.org/paetzke/format-sql.png?branch=master https://coveralls.io/repos/paetzke/format-sql/badge.png?branch=master https://pypip.in/v/format-sql/badge.png

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


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)

Uploaded Source

Built Distribution

format_sql-0.0.1-py2.py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page