$npx skillfedfor your agent

numpy-typing-compat

Static typing compatibility layer for older versions of NumPy

With conditionsPyPI Software DevelopmentReleased Jun 20263.9M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — numpy_typing_compat-20260602.2.5-py3-none-any.whl
v20260602.2.5 · released 2026-06-02 · Python >=3.12 · 1 runtime deps: numpy

Yes, if you are a library author supporting multiple NumPy versions and need static type-checkers to understand version-specific type differences. Use modern package managers (uv, pixi) to avoid manual version management. Not necessary for applications using a single NumPy version or if you rely on optype for higher-level typing utilities.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.12 or later.
  • The installed version of numpy-typing-compat must match your NumPy version—modern package managers handle this automatically, but pip requires manual version alignment.
  • Low install friction with a single runtime dependency on numpy.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows use in most projects without significant restrictions.

last release 2026-06-02 (73 days) · last repo commit 2026-08-14 · 6 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,920,133 downloads/mo, #2,452 on PyPI

Verify before relying

pip install numpy-typing-compat

from numpy_typing_compat import NUMPY_GE_2_1, StringDType

if NUMPY_GE_2_1:
    dtype = StringDType()
else:
    dtype = None
  • How well mypy and pyright actually support Literal-based version conditions in practice beyond the documented 'limited support'
  • Whether the package is actively used by optype or other production libraries beyond its intended helper role
Same gist for agents: .md · .json

What it is and what it does

numpy-typing-compat is a compatibility layer that lets you write NumPy type annotations that adapt to the installed NumPy version. It provides version-specific boolean constants (like NUMPY_GE_2_1) and type aliases (StringDType, ABCPolyBase, LiteralTrue, LiteralFalse) that static type-checkers can understand, similar to how you'd use sys.version_info for Python version checks. This is particularly useful for library authors who need to support multiple NumPy versions while maintaining accurate type hints.

The package is tightly coupled to NumPy versions—each release targets a specific NumPy minor version range (e.g., 20260602.2.5 targets numpy >=2.4,<2.5). Modern package managers like uv and pixi automatically install the correct version, but pip users must manually ensure alignment. The package is actively maintained and designed as a helper for the optype library, though it can be used directly when you need fine-grained version-aware typing.

Use it for

  • Library authors supporting multiple NumPy versions who need type-checkers to understand version-specific APIs without runtime overhead
  • Conditional type annotations for NumPy 2.0+ features like StringDType that weren't available in earlier versions
  • Handling NumPy 2.1+ generic type changes (ABCPolyBase) while maintaining backward compatibility with older versions
  • Type-safe use of NumPy 2.2+ bool scalar generics (LiteralTrue, LiteralFalse) across version boundaries

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are a library author supporting multiple NumPy versions and need static type-checkers to understand version-specific type differences.

Use modern package managers (uv, pixi) to avoid manual version management. Not necessary for applications using a single NumPy version or if you rely on optype for higher-level typing utilities.

Install

numpy-typing-compat on PyPI

Before you install

Low install friction with a single runtime dependency on numpy. Actively maintained as of 2026-08-14 with recent releases. Requires Python 3.12 or later and is designed to work with modern package managers like uv and pixi that respect version constraints; pip users must manually ensure version compatibility.

Requires Python 3.12 or later. The installed version of numpy-typing-compat must match your NumPy version—modern package managers handle this automatically, but pip requires manual version alignment.

License in practice

BSD-3-Clause permissive license allows use in most projects without significant restrictions.

Quickstart

pip install numpy-typing-compat

from numpy_typing_compat import NUMPY_GE_2_1, StringDType

if NUMPY_GE_2_1:
    dtype = StringDType()
else:
    dtype = None

Verify before relying

  • How well mypy and pyright actually support Literal-based version conditions in practice beyond the documented 'limited support'
  • Whether the package is actively used by optype or other production libraries beyond its intended helper role

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.12
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
numpy
MaintenanceActively maintained 73 days since the last release
Last repo commit
First released
Downloads3,920,133 / month, #2,452 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Typing :: Typed

Evidence: numpy_typing_compat-20260602.2.5-py3-none-any.whl

Tags

Capabilities
numpy version-specific type annotationsnumpy typing compatibility layerconditional numpy type hintsnumpy static type checkingnumpy version detection typingnumpy dtype type stubsnumpy 2.x typing support
Topics
numpy-typingtype-checkingversion-compat
PyPI keywords
numpyoptypetypingcompatibility

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “numpy version-specific type annotations”

  • numpy-typing-compatProvides version-specific type annotations for NumPy code, allowing…
  • pyversPyvers provides dynamic dispatch for Python functions based on…
  • jaxtypingProvides type annotations and runtime type-checking for array shape…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also scipy-stubs · typing · types-shapely · typing-aliases · types-colorama · optype · types-cffi · django-nine · types-Pygments · types-geopandas