Skip to main content

mysqltokenparser

https://img.shields.io/pypi/v/mysqltokenparser.svg https://img.shields.io/travis/LoveXiaoLiu/mysqltokenparser.svg Documentation Status Updates

A awesome tool that easy to get MySQL’s tokens.

Quickstart

0x01 Inistall

pip install mysqltokenparser

0x02 Tutorial

  • The library is so simple.

  • All types of SQL have different keys that are easy to identify.

  • And then You need to explore it.

import mysqltokenparser as mtp

sql = u"""
    ALTER TABLE t_a_gun2_6_dw_pfm_emp_cm ADD INDEX idx_eob_date(empid_org_bus (200),pfm_date);
"""

tokens = mtp.mysql_token_parser(sql)
print tokens
#{
#    "type": "ddl",
#    "data": {
#        "type": "altertable",
#        "data": {
#            "tablename": "t_a_gun2_6_dw_pfm_emp_cm",
#            "alter_data": [{
#                "type": "addindex",
#                "data": {
#                    "indexdefinition": {
#                        "columnnames": ["empid_org_bus", "pfm_date"]
#                    },
#                    "indexname": "idx_eob_date"
#                }
#            }]
#        }
#    }
#}

Features

  • Current version only support DDL(CREATE table, ALTER table), DML(simple SELECT, INSERT, DELETE, UPDATE).

  • TODO:SUPPORT MORE SQL STATEMENTS

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

2.2.0 (2019-11-25)

  • Add support DDL(CREATE table, ALTER table), DML(simple SELECT, INSERT, DELETE, UPDATE).

2.0.0 (2019-11-14)

  • Refactor API.

0.1.0 (2019-07-08)

  • First release on PyPI.

Metadata

Release files for mysqltokenparser 2.2.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 mysqltokenparser 2.2.0
File Size Uploaded
mysqltokenparser-2.2.0.tar.gz 406.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mysqltokenparser 2.2.0
File Interpreter ABI Platform
mysqltokenparser-2.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 821.2 kB

Release files / mysqltokenparser-2.2.0.tar.gz

Download URL mysqltokenparser-2.2.0.tar.gz
Size 406.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4a5b93179a58a7f91ac2f7b780451106adad05fbfd3a3ead98b2d964beffda65
BLAKE2b-256 checksum
How to use checksums
9b1135996f51468772b485116ba26c32cd6e92d65f446ee00d66e99da3cfc3b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

Release files / mysqltokenparser-2.2.0-py2.py3-none-any.whl

Download URL mysqltokenparser-2.2.0-py2.py3-none-any.whl
Size 414.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6bea93fdef8e99995b2ab1ff7fe4c74f8e85b8fc79c957115aae94023b0880bd
BLAKE2b-256 checksum
How to use checksums
3f4c7e62fc61ab19e6e770f95a18c7dd97fe829c83a748fc07cc81b646ecd282
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.2

2 release files

2.1.0

2 release files

1.0.0

2 release files

0.3.0

2 release files

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