This project has been archived by its maintainers, and is no longer receiving any updates.
Python array API standard typing
Documentation: https://array-api.readthedocs.io
Source Code: https://github.com/34j/array-api
Typing for array API and array-api-compat
Installation
Install this via pip (or your favourite package manager):
pip install array-api
Usage
Type stubs
Provices type stubs for array-api-compat.
import array_api_compat
xp = array_api_compat.array_namespace(x)
Array Type
from array_api._2024_12 import Array
def my_function[TArray: Array](x: TArray) -> TArray:
return x + 1
Namespace Type
You can test if an object matches the Protocol by:
import array_api_strict
from array_api._2024_12 import ArrayNamespace, ArrayNamespaceFull
assert isinstance(array_api_strict, ArrayNamespace)
# Full version contains fft and linalg
# fft and linalg are not included by default in array_api_strict
assert not isinstance(array_api_strict, ArrayNamespaceFull)
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Metadata
Release files for array-api 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| array_api-1.0.0.tar.gz | 365.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| array_api-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 734.3 kB
Release files / array_api-1.0.0.tar.gz
| Download URL | array_api-1.0.0.tar.gz |
|---|---|
| Size | 365.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e354c466f68daadc6a45330e1c90df5560d2c3fcaa351fd003ce8f1b85a37e17
|
|
BLAKE2b-256 checksum How to use checksums |
ea69c5015ba09a4c7dfc59de091c60c96d8555cfe81a3ab97b3491552c7ddda9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 13, 2025.
Transparency logRelease files / array_api-1.0.0-py3-none-any.whl
| Download URL | array_api-1.0.0-py3-none-any.whl |
|---|---|
| Size | 368.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bdc02b81c6c3f957324869b6abed19744630777541097e400e26f07881c8b07
|
|
BLAKE2b-256 checksum How to use checksums |
71772e33ceaf3fdf7959a18222a7ed1c56b1f7e746d3c07f9bf7f4810283da06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 13, 2025.
Transparency log