skillfed

array-api-strict

A strict, minimal implementation of the Python array API standard.

array-api-strict v2.6.1 183.4K downloads/30d#10,067 on PyPI33
Permissive 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) Active released

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-strict

uv

uv add array-api-strict

poetry

poetry add array-api-strict

Installing 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

License :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13

Tags

array api standard implementationtest array api complianceportable array library testingpython array api strictarray api validationnumpy array api wrapperarray api conformance testing
array-apitestingstandards-compliance

More Testing packages