Skip to main content

An SQL parser that uses LALR for sql parsing

Project description

# SqlAst

[![Pypi](https://img.shields.io/pypi/v/sqlast.svg?maxAge=600&style=for-the-badge)](https://pypi.python.org/pypi/sqlast)
[![Travis build](https://img.shields.io/travis/Vesuvium/sqlast.svg?maxAge=600&style=for-the-badge)](https://travis-ci.org/Vesuvium/sqlast)
[![Codacy grade](https://img.shields.io/badge/codequality-B-green.svg?style=for-the-badge)](https://app.codacy.com/app/Vesuvium/sqlast)
[![Codacy coverage](https://img.shields.io/badge/coverage-96%25-brightgreen.svg?style=for-the-badge)](https://app.codacy.com/app/Vesuvium/sqlast)

An SQL parser that uses LALR (instead of regex), providing precise, accurate
and complete SQL parsing. SqlAst is meant to be used as library, but a cli is
also provided.

Once the SQL is parsed, is provided as an abstract syntax tree that can be used
to transpile to another language, for example in an SQL to YAML transpiler,
to analyse the sql file, or to write your own SQL interpreter.


## Installing

```sh
pip install sqlast
```

## Usage

```python
from sqlast.App import SqlAst


tree = SqlAst.parse('hello.sql')
print(tree.pretty())
```

### Cli

```sh
sqlast parse hello.sql
```

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

sqlast-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.

sqlast-1.0.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sqlast-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for sqlast-1.0.0.tar.gz
Algorithm Hash digest
SHA256 37006f93f457f0954f61315fac4623cc58ebed0a44c4ebb1fa7b74d205069aa0
MD5 76a180320e7fba58ceeedb68e77de155
BLAKE2b-256 81d63bd8356f13668deef3d1c8708fb09a11a094e5376e2a05171cbc8aff7154

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sqlast-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for sqlast-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e414b81c3199f7b359c7e226899731ec41cbadbdf5f3f3c672596402487dbbe1
MD5 c340fa8d3f575bbee1d4fe7cf77734ed
BLAKE2b-256 eddcf1983e55f03e9482c9d9567a0111072aa14a34234840a07a460c52049b88

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