skillfed

scikit-learn-stubs

scikit-learn stubs from the Microsoft python-type-stubs repository

scikit-learn-stubs v0.0.3 336.3K downloads/30d#7,462 on PyPI3
Permissive license MIT AGING released

What it is and what it does

scikit-learn-stubs is a type stub package that provides type hints for scikit-learn, enabling static type checkers like mypy and pyright to understand scikit-learn's API. Type stubs are metadata files that describe the types of functions, classes, and methods without executing code, allowing developers to catch type errors during development rather than at runtime.

The package is a PyPI distribution of stubs originally from Microsoft's Python Type Stubs repository. It has no runtime dependencies and is installed purely to support development-time type checking. The package supports Python 3.9 through 3.13 and carries an MIT license. However, the package is newly released and shows minimal ongoing maintenance, which may affect how current the stubs remain relative to scikit-learn's own API evolution.

Use it for:

  • Enable mypy or pyright to type-check code that calls scikit-learn functions and classes.
  • Improve IDE autocomplete and inline documentation for scikit-learn in editors that support type stubs.
  • Catch type mismatches in machine learning pipelines during development before runtime.
  • Support continuous integration pipelines that enforce static type checking on scikit-learn-dependent code.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides type stubs for scikit-learn to enable static type checking in projects that use the library.

Yes, if you use scikit-learn and want static type checking in your project. Install it as a development dependency. However, verify that the stubs are current for your scikit-learn version, and monitor the repository for updates—the minimal maintenance signal and recent first release suggest this may not track scikit-learn changes closely. The Microsoft repository may be a more actively maintained alternative.

Install

scikit-learn-stubs on PyPI

pip

pip install scikit-learn-stubs

uv

uv add scikit-learn-stubs

poetry

poetry add scikit-learn-stubs

Installing scikit-learn-stubs

Before you install

Low friction install with no runtime dependencies. Package is newly released (first release 2025-08-27) and marked as aging after 351 days, with minimal maintenance activity and only 3 repository stars.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.

Quickstart

pip install scikit-learn-stubs

# Then use with type checker (mypy, pyright, etc.)
# in your IDE or CI pipeline for scikit-learn code

Requires Python 3.9 or later; type checking tool (mypy, pyright, pylance) must be separately configured to use the stubs.

Verify before relying

  • Whether stubs are kept in sync with scikit-learn releases given the minimal maintenance signal.
  • Coverage completeness of the stubs relative to the full scikit-learn API surface.
  • Whether this package is actively maintained or if the Microsoft repository is the recommended source.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 351 days since the last release
Last repo commit
First released
Downloads 336,315/month — #7,462 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: scikit_learn_stubs-0.0.3-py3-none-any.whl

Keywords: scikit-learn, sklearn, stubs

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPython

Tags

scikit-learn type stubssklearn type hintspython type checking sklearnscikit-learn static typingmypy scikit-learntype annotations machine learning
type-stubsstatic-analysis

More Software Development packages