MySQL Shell Python client
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 to perform the most common set of operations, in addition to a set of predefined queries to cover most of the common use-cases.
🧑💻 Usage
-
Install the package from PyPi:
pip install mysql-shell-client
-
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")
-
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:
- Bump up the version within the
pyproject.tomlfile. - Add a new section to the
CHANGELOG.md. - Commit + push the changes.
- Trigger the release workflow.
Metadata
Release files for mysql-shell-client 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mysql_shell_client-2.0.0.tar.gz | 20.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mysql_shell_client-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.8 kB
Release files / mysql_shell_client-2.0.0.tar.gz
| Download URL | mysql_shell_client-2.0.0.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f95c666ffc99bb36cae03d089c4d1d4cb29443ab4729f17737ec54de44c7d0ae
|
|
BLAKE2b-256 checksum How to use checksums |
7b8d3d964658604ce00e9cb7526dd2ceabdd5dc2001fd1f3a80b64ea117cc891
|
| 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 Sep 16, 2026.
Transparency logRelease files / mysql_shell_client-2.0.0-py3-none-any.whl
| Download URL | mysql_shell_client-2.0.0-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad81e6b75719ab900f6d09aeb8bc675ee514322e080227f05f4c4dd8b56d6cef
|
|
BLAKE2b-256 checksum How to use checksums |
4eb86a0e63dec8c0ca6afe31d8bba8538c4bc4214cd5b6a6c8bf4434c25cc89c
|
| 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 Sep 16, 2026.
Transparency log