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

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.2.1
File Size Uploaded
mparray-0.2.1.tar.gz 11.7 kB Details

Built distribution (wheel)

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

Total release size: 24.6 kB

Release files / mparray-0.2.1.tar.gz

Download URL mparray-0.2.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
61cb99fb52cfc098a1ab2933e746569678a6c9c081ad1d41d8dc39c83338ab67
BLAKE2b-256 checksum
How to use checksums
ba1a9a4279c517b39ad887d429793ac3e164ba0a6dd527944f6caa0ef8e03c79
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 Sep 2, 2026.

Transparency log

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

Download URL mparray-0.2.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ce254fa26cb09771ddd194e20b8af5af4c2e331e44a033504a9e829a24dfb50
BLAKE2b-256 checksum
How to use checksums
2ff4324a19b7dfdaf6b4c52cccf1dd1405c7eb7fe0d1573b8b0a064566c53fc9
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 Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

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