--- id: scipy-stubs version: "1.18.0.1" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # scipy-stubs — The official type stubs for SciPy License: permissive · Maintenance: active · Downloads: 3.9M/mo ## What it is and what it does scipy-stubs is the official type stub package for SciPy, maintained separately from SciPy itself to allow faster iteration and independent release cycles. It annotates the entire public SciPy API with precise type information, including array shapes and dtypes where applicable, and provides generic types for sparse arrays, distributions, splines, and linear operators. The stubs work transparently on install with no runtime impact—they affect only static type checking and IDE autocompletion. The package is tested against multiple type checkers (mypy, pyright, basedpyright, pyrefly, ty, and zuban) and is used by major projects. It requires Python 3.12 or later and depends on optype for array-like and shape-typing support. Installation is optional and opt-in; users who don't enable type checking won't see any behavioral change. Use it for: - Enable IDE autocompletion and error detection for SciPy code without modifying existing source - Run mypy or pyright on scientific Python projects to catch type errors in SciPy function calls - Track array shapes and dtypes through SciPy operations for numerical correctness verification - Use generic types for precise type hints on SciPy solver and distribution objects - Integrate type checking into CI/CD pipelines for scientific Python libraries that depend on SciPy ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides type stubs for the entire SciPy library, enabling static type checkers to understand SciPy's API with shape and dtype awareness. Yes. If you use SciPy and any static type checker (mypy, pyright, or similar), installing scipy-stubs is a straightforward win: low install friction, no runtime cost, active maintenance, permissive license, and broad tool support. Skip it only if you don't use type checking at all. ## Install pip install scipy-stubs uv add scipy-stubs poetry add scipy-stubs ## Installing scipy-stubs Before you install: Low friction: a pure-Python wheel with a single runtime dependency (optype). Active maintenance with releases every few weeks; last commit 2026-08-14. License in practice: BSD-3-Clause permissive license; no restrictions on use or redistribution in proprietary or open-source projects. Quickstart: pip install scipy-stubs import scipy.integrate from scipy.integrate import BDF Requires Python 3.12 or later Verify before relying: - Whether scipy-stubs works correctly with scipy versions newer than the stubs' own release, given the lack of an upper-bound enforcement - Runtime performance impact of the optype dependency during type checking or IDE operations ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags scipy type stubs, type checking scipy, scipy type hints, static typing scientific python, scipy mypy support, scipy type annotations, pep 561 scipy, type-stubs, static-typing [View on SkillFed](https://skillfed.io/packages/scipy-stubs) · [View on PyPI](https://pypi.org/project/scipy-stubs/)