Skip to main content

sql-format

Format your SQL statements using the sql-pretty-printer API.

Dependencies

This project uses the following modules:

Installation

To install, download the repository via:

git clone https://github.com/rrickgauer/sql-format.git

Usage

In the sql-format directory, use:

python sql-format.py

Example

sql-format will take the following SQL statement:

select Songs.id, Songs.title, Artists.name from Songs left join Artists on Songs.artist_id = Artists.id where Songs.id > 100 order by Songs.title desc limit 20;

and turns it into this:

SELECT Songs.id,
       Songs.title,
       Artists.name
FROM   Songs
       LEFT JOIN Artists
              ON Songs.artist_id = Artists.id
WHERE  Songs.id > 100
ORDER  BY Songs.title DESC
LIMIT  20;

Metadata

Release files for sql-format 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sql-format 0.1.0
File Size Uploaded
sql-format-0.1.0.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sql-format 0.1.0
File Interpreter ABI Platform
sql_format-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / sql-format-0.1.0.tar.gz

Download URL sql-format-0.1.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0009fab0aa403b5766e3f6db10a0cdd2f624e21add0fe7125c86730d888c8ee8
BLAKE2b-256 checksum
How to use checksums
3a147682c9bd512e38c937b9e8b0662e84649ef0142f8b0d0c44a9679cfd2100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

Release files / sql_format-0.1.0-py3-none-any.whl

Download URL sql_format-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
289a57bfe42fa18ebe03f901a1215e39dd266403f7cbb32b85b446d3bb761e11
BLAKE2b-256 checksum
How to use checksums
56044f97223e41a58498729cd8cdef41c56b8da3869851900f58c0c32922ace8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page