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 that exposes common operations alongside a set of predefined queries to cover typical 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mysql_shell_client-2.0.1.tar.gz | 20.6 kB | With provenance | Details for mysql_shell_client-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mysql_shell_client-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for mysql_shell_client-2.0.1-py3-none-any.whl |
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 logRelease 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 logSecurity for mysql-shell-client 2.0.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mysql_shell_client-2.0.1.tar.gz
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 logA 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.