Skip to main content

Get the mysql's tokens by the tool.

Project description

mysqltokenparser Documentation Status Updates

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


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"
#                }
#            }]
#        }
#    }


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


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


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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mysqltokenparser, version 2.2.0
Filename, size File type Python version Upload date Hashes
Filename, size mysqltokenparser-2.2.0-py2.py3-none-any.whl (414.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size mysqltokenparser-2.2.0.tar.gz (406.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page