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

Built distribution (wheel)

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

Total release size: 24.6 kB

Release files / mparray-0.2.0.tar.gz

Download URL mparray-0.2.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e2073cda4a41d0781c40911f1e9d6cd7a6e5d480ba09f6b45dfe749da50c023f
BLAKE2b-256 checksum
How to use checksums
f5f5fd3abba6bd42f56a9017487fc61a068962138e041b125dfe5de76ed38d39
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 1, 2026.

Transparency log

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

Download URL mparray-0.2.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a90c5cdddc60ef311fd6d0d2d0bfe95a057e5332cea006b7598b61d57e5aad6f
BLAKE2b-256 checksum
How to use checksums
086db4b1d4de4304c3c2554fcff29bab394ba732c20a1e298abb12701b66dbfb
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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

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