python-flint
Bindings for FLINT
What it is and what it does
Python-FLINT is a Python extension module that wraps FLINT (Fast Library for Number Theory) and Arb (arbitrary-precision ball arithmetic), exposing exact integer, rational, and modular arithmetic alongside arbitrary-precision real and complex numbers with rigorous error bounds. It provides polynomial, power series, and matrix types over all these number systems, plus a large collection of mathematical functions including number-theoretic operations, factorization, and numerical integration.
The library is designed for applications requiring exact symbolic computation or certified numerical results. It supports CPython 3.10–3.14 and provides prebuilt wheels for common platforms; source builds are available for other architectures. The package has no runtime Python dependencies and relies on the underlying FLINT C library, making it suitable for both interactive use and embedded in larger applications.
Use it for:
- Compute exact number-theoretic functions like partition counts and Bernoulli numbers without floating-point error.
- Perform polynomial arithmetic (GCD, factorization, evaluation) over exact integer and rational coefficients.
- Work with matrices of exact rationals or modular integers, including determinant and LLL reduction.
- Evaluate special functions and integrals with certified error bounds using arbitrary-precision ball arithmetic.
- Prototype symbolic mathematics computations before translating to production systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python bindings for FLINT and Arb that provide exact integer and rational arithmetic, arbitrary-precision real and complex numbers with error tracking, and polynomial, power series, and matrix operations over these types.
Yes, if you need exact arithmetic or certified numerical results. The package is actively maintained, has no known vulnerabilities, and provides prebuilt wheels for modern Python versions on common platforms. Install friction is moderate due to the compiled FLINT dependency, but wheels eliminate build complexity for supported platforms. Dual licensing (MIT/LGPL-3.0-or-later) requires attention to copyleft obligations if redistributing derivative works.
Install
python-flint on PyPI
pip
pip install python-flintuv
uv add python-flintpoetry
poetry add python-flintInstalling python-flint
Before you install
Prebuilt wheels available for CPython 3.10–3.14 on Windows, macOS, and Linux; medium install friction due to compiled C extension dependency on FLINT 3.0 or later, which may require system package installation or source build on unsupported platforms.
License in practice
Dual-licensed under MIT and LGPL-3.0-or-later; copyleft treatment means derivative works must comply with LGPL-3.0-or-later terms if distributed, though MIT applies to some components.
Quickstart
pip install python-flint
from flint import fmpz, fmpq, fmpz_poly
# Integer arithmetic
print(fmpz(1000).partitions_p())
# Rational arithmetic
print(fmpq.bernoulli(64))
# Polynomial GCD
a = fmpz_poly([1, 2, 3])
b = fmpz_poly([2, 3, 4])
print(a.gcd(a * b))
Requires FLINT 3.0 or later to be installed on the system; prebuilt wheels available for CPython 3.10–3.14 on Windows (x86-64), macOS (x86-64, arm64), and Linux (x86-64, aarch64).
Verify before relying
- Performance characteristics compared to other arbitrary-precision libraries for specific workloads.
- Stability and completeness of free-threaded (no-GIL) build support marked as experimental.
- Extent of missing FLINT type wrappings (finite field matrices, p-adic numbers, rational functions).
Package facts
| License | MIT AND LGPL-3.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 42 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 86,095/month — #13,886 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_flint-0.9.0-cp310-abi3-macosx_10_9_x86_64.whl; python_flint-0.9.0-cp310-abi3-macosx_11_0_arm64.whl; python_flint-0.9.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; python_flint-0.9.0-cp310-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; python_flint-0.9.0-cp310-abi3-win_amd64.whl; python_flint-0.9.0-cp310-abi3-win_arm64.whl; python_flint-0.9.0-cp313-cp313-macosx_10_13_x86_64.whl; python_flint-0.9.0-cp313-cp313-macosx_11_0_arm64.whl; python_flint-0.9.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; python_flint-0.9.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; python_flint-0.9.0-cp313-cp313-win_amd64.whl; python_flint-0.9.0-cp313-cp313-win_arm64.whl; python_flint-0.9.0-cp314-cp314-macosx_10_15_x86_64.whl; python_flint-0.9.0-cp314-cp314-macosx_11_0_arm64.whl; python_flint-0.9.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; python_flint-0.9.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; python_flint-0.9.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl; python_flint-0.9.0-cp314-cp314t-macosx_10_15_x86_64.whl; python_flint-0.9.0-cp314-cp314t-macosx_11_0_arm64.whl; python_flint-0.9.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
galoisGalois extends NumPy arrays to perform…
permissive · top 15,000 on PyPI
cypari2cypari2 provides a Python interface to PARI/GP,…
copyleft · top 15,000 on PyPI
fixedintProvides fixed-width integer classes that…
permissive · top 5,000 on PyPI
intbitsetintbitset provides a fast, memory-efficient set…
copyleft · top 15,000 on PyPI
passagemath-objectsProvides a foundational object system,…
copyleft · top 15,000 on PyPI
transforms3dConverts between different 3D geometric…
permissive · top 15,000 on PyPI
typedunitsImplements unit of measurement arithmetic with…
permissive · top 15,000 on PyPI
pyglmPyGLM provides Python bindings to OpenGL…
permissive · top 15,000 on PyPI