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/
    

⚠️ 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.0.6

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.0.6
File Size Uploaded
omnisql-1.0.6.tar.gz 3.4 kB Details

Built distribution (wheel)

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

Total release size: 7.4 kB

Release files / omnisql-1.0.6.tar.gz

Download URL omnisql-1.0.6.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5c321eb52eb393fdabbb13a70ea3ba076ff3c75bca009689bfee2e80baae30d9
BLAKE2b-256 checksum
How to use checksums
e6eae6a015eeaa7b39cff532dfe586abb04ce72ef41eec27505e885b10751856
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.0.6-py3-none-any.whl

Download URL omnisql-1.0.6-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb94c4a46d740067d4e4fe6c5950cd65772322667c7c7952247930eb3f58c475
BLAKE2b-256 checksum
How to use checksums
0c4249372ed1859dd17944c7f5f5ffe8b2004c378c6a45d20b1b361b039c3fa5
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

1.1.0

2 release files

This release

1.0.6 This release

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