array-api-strict
A strict, minimal implementation of the Python array API standard.
What it is and what it does
array-api-strict is a reference implementation of the Python array API standard designed specifically for testing, not for end-user consumption. It wraps numpy to provide a strict, minimal interface that conforms to the array API specification. The package is intended to be used in test suites of libraries that consume the array API—such as machine learning frameworks or scientific computing packages—to verify that their code will work correctly across different array libraries (NumPy, CuPy, PyTorch, etc.) without relying on library-specific features.
The package is not meant to replace numpy or other array libraries for production use, nor to be added as a dependency to consuming libraries themselves. Instead, it serves as a validation tool: by running tests against array-api-strict, developers can confirm their array API usage is portable and standards-compliant. It supports Python 3.10 and later, has low install friction (only numpy as a runtime dependency), and is actively maintained.
Use it for:
- Test array API compliance in a library's test suite to ensure code works across NumPy, CuPy, PyTorch, and other array libraries.
- Validate that a consuming library does not accidentally use non-standard array operations or library-specific features.
- Develop array-agnostic code by testing against a strict reference implementation before deploying to production.
- Verify portability of numerical algorithms across different array backends during development.
- Catch array API violations early in the development cycle before releasing a library.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a strict, minimal implementation of the Python array API standard for testing whether consuming libraries use the array API portably, built on numpy.
Yes, if you are developing a library that consumes the array API and want to verify your code is portable across array libraries. Install it as a test-time dependency only, not as a runtime dependency. It is not intended for end-users of array libraries or for production use.
Install
array-api-strict on PyPI
pip
pip install array-api-strictuv
uv add array-api-strictpoetry
poetry add array-api-strictInstalling array-api-strict
Before you install
Low friction install with a single runtime dependency (numpy). Actively maintained with a recent release (18 days ago) and ongoing commits.
License in practice
BSD license (permissive); you can use, modify, and distribute this package with minimal restrictions, provided you retain copyright notices and disclaimers.
Quickstart
pip install array-api-strict
import array_api_strict as xp
# Use in test suite to validate array API compliance
x = xp.asarray([1, 2, 3])
result = xp.sum(x)
Requires Python 3.10 or later.
Verify before relying
- Whether this package is actively used in test suites of major array-consuming libraries.
- How complete the array API implementation is relative to the full standard specification.
Package facts
| License | Copyright (c) 2021-2024, NumPy Developers, Consortium for Python Data API Standards All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 18 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 183,403/month — #10,067 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: array_api_strict-2.6.1-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
array-api-compatProvides a unified wrapper around NumPy, CuPy,…
permissive · top 5,000 on PyPI
array-api-extraProvides extra array manipulation functions…
permissive · top 15,000 on PyPI
autorayAutoray provides automatic dispatch of array…
permissive · top 15,000 on PyPI
dataframe-api-compatProvides a lightweight compatibility layer that…
permissive · top 15,000 on PyPI
numexprNumExpr evaluates numerical expressions on…
permissive · top 5,000 on PyPI
awkward0Manipulates complex, non-rectangular data…
permissive · top 15,000 on PyPI
numpydanticNumpydantic adds type annotations and…
permissive · top 15,000 on PyPI
nptypingProvides type hints and runtime type checking…
permissive · top 15,000 on PyPI
awkward-cppProvides compiled C++ kernels and extensions…
permissive · top 5,000 on PyPI
msgpack-numpy-opentensorSerializes and deserializes NumPy arrays and…
permissive · top 15,000 on PyPI