cypari2
A Python interface to the number theory library PARI/GP
Decision gist · record as of 2026-08-14
Yes, if you need computational number theory in Python and accept GPL-2.0-or-later licensing. The package is actively maintained, has no known vulnerabilities, and offers pre-built wheels for modern Python versions, reducing install friction. Not suitable for proprietary software without GPL compliance or a separate license. Verify that pre-built wheels include the specific PARI/GP features you need before committing to this dependency.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.12.
- Pre-built wheels available for Linux (x86_64, aarch64), macOS (x86_64, arm64), and musllinux; building from source requires PARI/GP >= 2.9.4 headers, GMP, C compiler, and pkg-config.
- Medium install friction due to compiled C extension and runtime dependency on cysignals.
License · maintenance · safety
GPL-2.0-or-later (copyleft) — Licensed under GPL-2.0-or-later (copyleft). Use in proprietary software requires either GPL compliance or a separate commercial license; derivative works must be distributed under compatible terms.
last release 2025-10-31 (287 days) · last repo commit 2026-07-27 · 32 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 126,161 downloads/mo, #11,787 on PyPI
Alternatives
Verify before relying
pip install cypari2
import cypari2
pari = cypari2.Pari()
result = pari(2).zeta()
print(result)- Whether pre-built wheels include all PARI/GP functionality or if some features require compilation from source.
- Performance characteristics compared to direct PARI/GP or other number theory libraries.
- Stability and API compatibility guarantees across minor versions.
What it is and what it does
cypari2 is a Python wrapper around PARI/GP, a mature C library for computational number theory. It exposes PARI's functions as methods on Python objects, allowing you to perform operations like polynomial factorization, zeta function evaluation, and finite field arithmetic from Python code. The interface mirrors PARI/GP's syntax closely—you can pass Python integers, floats, or PARI expression strings to the Pari() constructor and call methods directly on the resulting objects.
The package depends on cysignals for signal handling and requires a C compiler and PARI/GP headers to build from source, though pre-built wheels are available for Python 3.12+ on Linux, macOS, and musllinux. It is actively maintained by the SageMath community and carries a GPL-2.0-or-later license, which restricts use in proprietary software unless you comply with GPL terms or obtain a separate license.
Use it for
- Compute number-theoretic functions like zeta, factorization, and elliptic curve operations in Python scripts.
- Factor polynomials over finite fields and perform algebraic number theory computations.
- Prototype mathematical algorithms that will later be implemented in compiled code.
- Integrate PARI/GP computations into larger Python scientific or educational applications.
- Perform modular arithmetic and finite field operations for cryptographic research.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need computational number theory in Python and accept GPL-2.0-or-later licensing.
The package is actively maintained, has no known vulnerabilities, and offers pre-built wheels for modern Python versions, reducing install friction. Not suitable for proprietary software without GPL compliance or a separate license. Verify that pre-built wheels include the specific PARI/GP features you need before committing to this dependency.
Install
cypari2 on PyPI
Before you install
Medium install friction due to compiled C extension and runtime dependency on cysignals. Pre-built wheels available for modern Python (3.12+) on common platforms reduce friction; building from source requires PARI/GP headers, GMP, C compiler, and pkg-config. Package is actively maintained by the SageMath community with recent commits.
Requires Python >= 3.12. Pre-built wheels available for Linux (x86_64, aarch64), macOS (x86_64, arm64), and musllinux; building from source requires PARI/GP >= 2.9.4 headers, GMP, C compiler, and pkg-config.
License in practice
Licensed under GPL-2.0-or-later (copyleft). Use in proprietary software requires either GPL compliance or a separate commercial license; derivative works must be distributed under compatible terms.
Quickstart
pip install cypari2
import cypari2
pari = cypari2.Pari()
result = pari(2).zeta()
print(result)
Verify before relying
- Whether pre-built wheels include all PARI/GP functionality or if some features require compilation from source.
- Performance characteristics compared to direct PARI/GP or other number theory libraries.
- Stability and API compatibility guarantees across minor versions.
Package facts
| License | GPL-2.0-or-later copyleft |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagecysignals |
| Maintenance | Actively maintained 287 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 126,161 / month, #11,787 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: cypari2-2.2.4-cp312-cp312-macosx_13_0_x86_64.whl; cypari2-2.2.4-cp312-cp312-macosx_15_0_arm64.whl; cypari2-2.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cypari2-2.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cypari2-2.2.4-cp312-cp312-musllinux_1_2_aarch64.whl; cypari2-2.2.4-cp312-cp312-musllinux_1_2_x86_64.whl; cypari2-2.2.4-cp313-cp313-macosx_13_0_x86_64.whl; cypari2-2.2.4-cp313-cp313-macosx_15_0_arm64.whl; cypari2-2.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cypari2-2.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cypari2-2.2.4-cp313-cp313-musllinux_1_2_aarch64.whl; cypari2-2.2.4-cp313-cp313-musllinux_1_2_x86_64.whl; cypari2-2.2.4-cp314-cp314-macosx_13_0_x86_64.whl; cypari2-2.2.4-cp314-cp314-macosx_15_0_arm64.whl; cypari2-2.2.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cypari2-2.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cypari2-2.2.4-cp314-cp314-musllinux_1_2_aarch64.whl; cypari2-2.2.4-cp314-cp314-musllinux_1_2_x86_64.whl; cypari2-2.2.4-cp314-cp314t-macosx_13_0_x86_64.whl; cypari2-2.2.4-cp314-cp314t-macosx_15_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “PARI/GP Python interface”
- cypari2cypari2 provides a Python interface to PARI/GP, a number theory…
- scale-gp-betaPython client library for the Scale GP REST API with type-safe…
- gpytorchGPyTorch is a PyTorch-based Gaussian process library that enables…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also fpylll · sagemath · passagemath-gap · symengine · galois · python-flint · passagemath-categories