Skip to main content

MPArray is an Array API Standard compatible array library that features arbitrary precision arithmetic.

Install with pip:

pip install mparray

Import to access the array namespace:

import mparray as xp

Use any feature defined by the 2025.12 version of the standard:

x = xp.arange(5)
# MPArray([0, 1, 2, 3, 4], dtype=int64)

Integer arrays are filled with Python ints; consequently, elements never overflow.

x = x[:2] + 10**50
# MPArray([100000000000000000000000000000000000000000000000000,
#          100000000000000000000000000000000000000000000000001],
#         dtype=int64)

Dtypes follow array API promotion rules for compatibility, but do not limit the underlying representation. For instance, int32 arrays also use Python ints.

xp.astype(x, xp.int32)
# MPArray([100000000000000000000000000000000000000000000000000,
#          100000000000000000000000000000000000000000000000001],
#         dtype=int32)

Real and complex floating point arrays are backed by mpmath.

from mpmath import mp
mp.dps = 55  # set the desired precision
y = xp.astype(x, xp.float64)
# MPArray([mpf('100000000000000000000000000000000000000000000000000.0'),
#          mpf('100000000000000000000000000000000000000000000000001.0')],
#         dtype=float64)
xp.exp(y)
# MPArray([mpf('4.535356657536074105363661926352788592352627616652483210606e+43429448190325182765112891891660508229439700580366'),
#          mpf('1.232837758776106335937289338644047193491770865081040599056e+43429448190325182765112891891660508229439700580367')],
#         dtype=float64)

Arbitrary-precision equivalents of some SciPy special functions are available:

xp.special.ndtr(-y)
# MPArray([mpf('8.998129248551223738202088675072137970394711995443364311445e-2171472409516259138255644594583025411471985029018332830572230087781144236110599295949020894164292471'),
#          mpf('6.461085845597172042837958170074610008600868697345677551181e-2171472409516259138255644594583025411471985029018376260020420755455996799425617236333573042128793971')],
#         dtype=float64)

Metadata

Release files for mparray 0.1.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 mparray 0.1.0
File Size Uploaded
mparray-0.1.0.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mparray 0.1.0
File Interpreter ABI Platform
mparray-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / mparray-0.1.0.tar.gz

Download URL mparray-0.1.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
43619df7a775a6134ddcca3e5ac54dfe60836bbab9f64878e8a379960f169deb
BLAKE2b-256 checksum
How to use checksums
6974dc3ea48f266d4a32efe921295fc11b068418b6c187df914fdaadd1d44663
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 30, 2026.

Transparency log

Release files / mparray-0.1.0-py3-none-any.whl

Download URL mparray-0.1.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df5d9cafb0fdb48273b87a700af3fbeb32d054caa9b52dc72e471e95a28b22eb
BLAKE2b-256 checksum
How to use checksums
2fe1c460a2445b11e39963b41f8ba73946b776f794fb12b769715f65832dccc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 30, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.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