data-science-types
Type stubs for Python machine learning libraries
What it is and what it does
This is a stub-only package that teaches mypy, pytype, and PyCharm how to type-check code using NumPy, pandas, and Matplotlib. It does not add runtime behavior—it only provides type information for static analysis. The stubs are PEP-561 compliant, meaning type checkers will automatically recognize them when the package is installed.
The package is explicitly a work in progress and incomplete. Many functions lack type annotations in the stubs. As a result, you may encounter type checker errors claiming functions do not exist when they actually do. The project was archived and has not been maintained since 2021-02-16, so new library features and API changes are not reflected in the stubs.
Use it for:
- Catch type errors in array operations before runtime, such as incorrect dtype assignments or incompatible arithmetic.
- Enable IDE autocompletion and type hints for data structures in editors like PyCharm.
- Validate plotting code with type checking to catch incorrect argument types to functions.
- Add static type safety to data science scripts without waiting for upstream libraries to ship their own stubs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides PEP-561-compliant type stubs for NumPy, pandas, and Matplotlib, enabling mypy and other type checkers to recognize and validate types in these libraries.
No. The package is abandoned and has not been maintained since 2021-02-16. While it has no runtime dependencies and installs easily, its incomplete stub coverage combined with lack of maintenance means it will produce false negatives and false positives. Modern versions of the supported libraries have either shipped their own stubs or improved type support, making this package obsolete for current projects.
Install
data-science-types on PyPI
pip
pip install data-science-typesuv
uv add data-science-typespoetry
poetry add data-science-typesInstalling data-science-types
Before you install
Installation is frictionless with no runtime dependencies. However, the package is abandoned and has not been maintained since 2021-02-16, which means type coverage gaps will persist and newer library versions may lack stub support.
License in practice
Licensed under Apache License 2.0 (permissive), so you can use it freely in commercial and open-source projects without restriction.
Quickstart
pip install data-science-types
# Then type checkers will recognize types in the supported libraries
# Example from the package documentation:
arr1: np.ndarray[np.int64] = np.array([3, 7, 39, -3]) # OK
arr2: np.ndarray[np.int32] = np.array([3, 7, 39, -3]) # Type error
Requires Python 3.6 or later. Type coverage is incomplete; many functions lack stubs, so type checkers may report false 'function does not exist' errors.
Verify before relying
- Current compatibility with recent versions of NumPy, pandas, and Matplotlib given the last release was 2021-02-16
- Whether stub coverage has improved or regressed relative to upstream library API changes since abandonment
- How much of NumPy and pandas functionality is actually covered by the stubs
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,005 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 180,978/month — #10,135 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: data_science_types-0.2.23-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
nptypingProvides type hints and runtime type checking…
permissive · top 15,000 on PyPI
types-dataclassesProvides type stubs for Python's dataclasses…
permissive · top 15,000 on PyPI
types-attrsProvides PEP 561 type stubs for the attrs…
permissive · top 15,000 on PyPI
types-backportsProvides PEP 561 type stubs for the backports…
permissive · top 15,000 on PyPI
types-cryptographyProvides PEP 561 type stubs for the…
permissive · top 5,000 on PyPI
types-futuresProvides type stubs for the futures package,…
permissive · top 15,000 on PyPI
types-chardetProvides type stubs for character encoding…
permissive · top 5,000 on PyPI
types-freezegunProvides type stubs for the freezegun…
permissive · top 5,000 on PyPI
types-WerkzeugProvides PEP 561 type stubs for Werkzeug,…
permissive · top 5,000 on PyPI
pydantic-numpyIntegrates NumPy arrays into Pydantic models…
permissive · top 15,000 on PyPI