Skip to main content

Format embedded sql (squeel) in python source code files

Project description

Squeel

Format embedded sql (squeel) in python source code files.

Uses treesitter to query python strings inside the python files starting with a sql comment -- sql. Then formats the sql matching strings with the selected formatter, by default pg_format, and writes them back to the files.

Uses one of sqlparse or pg_format to format the SQL within the python code.

Requirements

pgFormatter if using the default format strategy pg_format

Install

pip install squeel

Usage

See squeel -h

Example:

squeel --glob *.py --format_strategy sqlparse src

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

squeel-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

squeel-1.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file squeel-1.0.0.tar.gz.

File metadata

  • Download URL: squeel-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.11.0

File hashes

Hashes for squeel-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5ad1ae83a46e64eace079fb49086fb48b8dbfa6bdbe29146698df9a05cd9018a
MD5 cbbbda15cbd2e6d51e6b9e46cf550a7c
BLAKE2b-256 2484505a88e3551320927e46171a45a77a92edfb728690d2afbd20e994495161

See more details on using hashes here.

File details

Details for the file squeel-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: squeel-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.11.0

File hashes

Hashes for squeel-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71e4d7ee11bd3ab8ff8f2ab720614523998b5c74d38fc1efe0868a4bf4a70b1a
MD5 dbbc9fa3b4f2e49f84ddfb6aa2acb1e9
BLAKE2b-256 aeb16287893570343227b3f5b8ae87ae2524bd6b8160d62820cadcb73dfc7763

See more details on using hashes here.

Supported by

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