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-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

sqlast-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sqlast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 daf769b9f4fc2834a2eb9bfb4d9ab4c1f3778600a32fc1fb02cddda4a0163b12
MD5 218194ca98b0e97ad7c3f8684261c9f2
BLAKE2b-256 ea293a06b515061168a34e3aa611893aa9b54e37d2825c930271a57622edf284

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sqlast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec93d0c864d957e0d029f044422a3f83a00b9af707c2406f9901ab43251fd55e
MD5 92ab16d47d698a522f2a41b2f6f1f321
BLAKE2b-256 e34cb5251641b05de971564fa615a0defd2dc72809ba4f6d25b8522295359f1d

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