Skip to main content

Build Status

NAME

mysql_grantparser - parse MySQL SHOW GRANTS

SYNOPSIS

import mysql_grantparser

grants = mysql_grantparser.Exporter(
    host='127.0.0.1',
    port=3306,
    user='root',
    password='pa55w0rd',
).export()

DESCRIPTION

mysql_grantparser is SHOW GRANTS parser for MySQL, inspired by Ruby's Gratan.

This module returns privileges for all users as following dict.

{
    'USER@HOST': {
        'user': USER,
        'host': HOST,
        'objects': {
            'DB_NAME.TABLE_NAME': {
                'privs': [ PRIV_TYPE, PRIV_TYPE, ... ],
                'with': 'GRANT OPTION',
            },
            ...
        },
        'options': {
            'identified': '...',
            'required': '...',
        },
    },
    ...
}

For example, this GRANT statement

GRANT SELECT, INSERT, UPDATE, DELETE ON orcl.* TO 'scott'@'%' IDENTIFIED BY 'tiger' WITH GRANT OPTION;

is represented as following.

{
    'scott@%': {
        'user': 'scott',
        'host': '%',
        'objects': {
            '*.*': {
                privs: [
                    'USAGE'
                ],
            },
            'orcl.*': {
                'privs': [
                    'SELECT',
                    'INSERT',
                    'UPDATE',
                    'DELETE',
                ],
                'with': 'GRANT OPTION',
            }
        },
        'options': {
            'identified': "PASSWORD XXX",
        },
    },
}

SEE ALSO

Metadata

Release files for mysql-grantparser 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mysql-grantparser 1.0.5
File Size Uploaded Provenance
mysql-grantparser-1.0.5.tar.gz 5.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mysql-grantparser 1.0.5
File Interpreter ABI Platform
mysql_grantparser-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / mysql-grantparser-1.0.5.tar.gz

Download URL mysql-grantparser-1.0.5.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f26665a0f3e1c9790c8f2d0547377cada59fb4d3078e33d43fb0de8b4f1143f3
BLAKE2b-256 checksum
How to use checksums
674c6569e5b8ea62d4f28c5be5ebe4ebf3438cbe958d59cf29170105d3f09d6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.3

Release files / mysql_grantparser-1.0.5-py3-none-any.whl

Download URL mysql_grantparser-1.0.5-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5137b23606402ef809249324561f73d3f7033ffce314515c181bf7b2822a9ba
BLAKE2b-256 checksum
How to use checksums
f91df1d29cf87ddc08669552bc51bdd5b98c59f630f3920b29dfa6a1fcd3431c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.3

Security for mysql-grantparser 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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