Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Python array API standard typing

CI Status Documentation Status Test coverage percentage

uv Ruff pre-commit

PyPI Version Supported Python versions License


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)

Screenshot 1 Screenshot 2

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

Copier

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)

Source distribution for array-api 1.0.0
File Size Uploaded
array_api-1.0.0.tar.gz 365.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for array-api 1.0.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page