Skip to main content

MySQL Shell Python client

CI/CD Status Coverage Status Apache license

MySQL Shell is an advanced client for MySQL Server that allow system administrator to perform both cluster and instance level operations, using a single binary.

This project provides a Python client that exposes common operations alongside a set of predefined queries to cover typical use-cases.

🧑‍💻 Usage

  1. Install MySQL Shell.

  2. Install the package from PyPi:

    pip install mysql-shell-client
    
  3. Import and build the executors:

    from mysql_shell.executors import LocalExecutor
    from mysql_shell.models import ConnectionDetails
    
    cluster_conn = ConnectionDetails(
        username="...",
        password="...",
        host="...",
        port="...",
    )
    instance_conn = ConnectionDetails(
        username="...",
        password="...",
        host="...",
        port="...",
    )
    
    cluster_executor = LocalExecutor(cluster_conn, "mysqlsh")
    instance_executor = LocalExecutor(instance_conn, "mysqlsh")
    
  4. Import and build the clients:

    from mysql_shell.builders.quoting import ArgsQuoter, QueryQuoter
    from mysql_shell.clients import ClusterClient, InstanceClient
    
    args_quoter = ArgsQuoter()
    query_quoter = QueryQuoter()
    
    cluster_client = ClusterClient(cluster_executor, args_quoter)
    instance_client = InstanceClient(instance_executor, query_quoter)
    

🔧 Development

Dependencies

In order to install all the required packages:

poetry install --all-extras

Linting

All Python files are linted using Ruff, to run it:

tox -e lint

Testing

Project testing is performed using Pytest, to run them:

tox -e unit
export MYSQL_DATABASE="test"
export MYSQL_USERNAME="root"
export MYSQL_PASSWORD="root_pass"
export MYSQL_SHELL_PATH="mysqlsh"

sudo --preserve-env docker compose -f compose/mysql-8.0.yaml up --wait && tox -e integration
sudo --preserve-env docker compose -f compose/mysql-8.0.yaml down

Release

Commits can be tagged to create releases of the package, in order to do so:

  1. Bump up the version within the pyproject.toml file.
  2. Add a new section to the CHANGELOG.md.
  3. Commit + push the changes.
  4. Trigger the release workflow.

Metadata

Release files for mysql-shell-client 2.0.1

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-shell-client 2.0.1
File Size Uploaded
mysql_shell_client-2.0.1.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mysql-shell-client 2.0.1
File Interpreter ABI Platform
mysql_shell_client-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 50.9 kB

Release files / mysql_shell_client-2.0.1.tar.gz

Download URL mysql_shell_client-2.0.1.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8a23187cfa9c2d52c505ee220f70b3b902f0186e8d40258501f99b64c5b2f750
BLAKE2b-256 checksum
How to use checksums
38877c682d3041bb1379119761a5e87007b2b4577a5e6c9b40cf061e75976599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / mysql_shell_client-2.0.1-py3-none-any.whl

Download URL mysql_shell_client-2.0.1-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8ac1a847a9bfe7478e1ea02790081b015dd8d2693d17c39a5c5942d35d6348a
BLAKE2b-256 checksum
How to use checksums
a0eb2a07878583790bd3e9abdc1e4761616de27fc249c03e85ee22a4a1d80642
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

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