types-mysqlclient
Typing stubs for mysqlclient
What it is and what it does
types-mysqlclient is a type stub package that supplies type annotations for the mysqlclient MySQL driver. It allows Python type checkers like mypy and pyright to understand the types and signatures of mysqlclient's API, catching type errors in your code before runtime. The stubs are maintained as part of the typeshed project and are tested against current versions of popular type checkers.
This package does not provide mysqlclient itself—you must install mysqlclient separately to actually connect to MySQL databases. The stubs are purely informational for static analysis tools. They target mysqlclient 2.2.* and require Python 3.10 or later.
Use it for:
- Enable mypy or pyright to type-check code that imports and uses mysqlclient.
- Catch type mismatches in database connection parameters and query results before runtime.
- Provide IDE autocomplete and type hints when working with mysqlclient in an editor.
- Enforce type safety in a CI/CD pipeline that runs static type checking on Python projects using MySQL.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type annotations for the mysqlclient MySQL database driver, enabling static type checking of code that uses mysqlclient.
Yes, if you use mysqlclient and run static type checking. It has no runtime cost, low install friction, and is actively maintained. Install it alongside mysqlclient in development and CI environments to catch type errors early. Not necessary if you don't use type checkers.
Install
types-mysqlclient on PyPI
pip
pip install types-mysqlclientuv
uv add types-mysqlclientpoetry
poetry add types-mysqlclientInstalling types-mysqlclient
Before you install
Low friction; pure Python stub package with no runtime dependencies. Actively maintained as part of typeshed, last updated 98 days ago.
License in practice
Apache-2.0 permissive license allows free use, modification, and distribution with minimal restrictions.
Quickstart
pip install types-mysqlclient
# Then use with type checker (mypy, pyright)
# mypy your_code.py
# or configure in pyproject.toml/mypy.ini
Requires Python 3.10 or later; only provides type information, does not provide mysqlclient itself.
Verify before relying
- Whether this stub version remains synchronized with mysqlclient 2.2.* releases after typeshed updates.
- Compatibility with type checkers beyond mypy 1.20.0 and pyright 1.1.408.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 98 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 287,769/month — #8,027 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_mysqlclient-2.2.0.20260508-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
types-PyMySQLProvides type stubs for PyMySQL to enable…
permissive · top 5,000 on PyPI
types-tabulateProvides type hints for the tabulate package,…
permissive · top 5,000 on PyPI
types-Flask-MigrateProvides type hints for Flask-Migrate, enabling…
permissive · top 15,000 on PyPI
mysqlThis package is a deprecated virtual wrapper…
permissive · top 15,000 on PyPI
mysqlclientmysqlclient provides a Python interface to…
copyleft · top 1,000 on PyPI
types-pyperclipProvides type annotations for the pyperclip…
permissive · top 15,000 on PyPI
types-jmespathProvides type annotations for the jmespath…
permissive · top 5,000 on PyPI
types-MarkdownProvides type stubs for the Markdown package,…
permissive · top 5,000 on PyPI
types-mypy-extensionsProvides type stubs for mypy-extensions,…
permissive · top 15,000 on PyPI
types-tomlProvides type hints for the toml package,…
permissive · top 1,000 on PyPI