Skip to main content

OmniSQL Python Wrapper

This is the Python wrapper for OmniSQL, a blazing-fast SQL linter built in Rust.

For full documentation, visit the main repository.

Usage Guide

Linting Commands

You can run OmniSQL from the command line to lint your SQL files:

  • Lint a single file:

    omnisql lint path/to/query.sql
    
  • Lint an entire directory:

    omnisql lint ./sql_queries/
    
  • Auto-fix violations:

    omnisql lint --fix ./sql_queries/
    
  • Lint with a specific configuration file:

    omnisql lint --config path/to/omnisql.yaml ./sql_queries/
    
  • Lint with a DDL schema (for semantic validation):

    omnisql lint --schema path/to/schema.sql ./sql_queries/
    

    To apply style fixes while validating against a schema, add the --fix flag:

    omnisql lint --fix --schema path/to/schema.sql ./sql_queries/
    
  • Lint with a dbt manifest (for native dbt project validation):

    omnisql lint --dbt-manifest target/manifest.json ./sql_queries/
    

    To apply style fixes while validating against a manifest, add the --fix flag:

    omnisql lint --fix --dbt-manifest target/manifest.json ./sql_queries/
    
  • Lint with a specific SQL dialect (e.g., Snowflake): OmniSQL defaults to PostgreSQL. If you are parsing Snowflake-specific syntax (like VARIANT JSON paths or QUALIFY clauses), switch the dialect:

    omnisql lint --dialect snowflake ./sql_queries/
    

⚠️ Disclaimer regarding Auto-Fix (--fix): OmniSQL's auto-fix engine currently only resolves stylistic violations (such as SQL keyword casing and trailing commas). It will not automatically repair semantic, cost, or security errors (e.g., it will not auto-generate missing JOIN conditions or automatically mask PII columns).

Upgrading OmniSQL

To stay up to date with the latest features, performance improvements, and rule additions, you can upgrade OmniSQL via PyPI:

pip install --upgrade omnisql

Metadata

Release files for omnisql 1.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 omnisql 1.1.0
File Size Uploaded
omnisql-1.1.0.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for omnisql 1.1.0
File Interpreter ABI Platform
omnisql-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / omnisql-1.1.0.tar.gz

Download URL omnisql-1.1.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c4e7feed867edaf191ddfba359d98461cb94efaad8062d9d21a5bd57a4a652cd
BLAKE2b-256 checksum
How to use checksums
5b89330ba38bcf15a15103a5f832b219c521eaae2d55965cc2740f0eacde668c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / omnisql-1.1.0-py3-none-any.whl

Download URL omnisql-1.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40f5b1ad4a6dce6e7168d5a8bf44fa0de72fe45bced2423ecaafb3196bf643e1
BLAKE2b-256 checksum
How to use checksums
d247c4fa26d809c7329a27faa96cb3b1f4bf8497a5e20b563a37204a2f7bed5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

1 release file

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