--- id: cypari2 version: "2.2.4" license: GPL-2.0-or-later license_treatment: copyleft maintenance: active --- # cypari2 — A Python interface to the number theory library PARI/GP License: copyleft · Maintenance: active · Downloads: 126.2K/mo ## 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 above — verify before relying. cypari2 provides a Python interface to PARI/GP, a number theory library, exposing PARI functions as Python methods on wrapped objects. 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 pip install cypari2 uv add cypari2 poetry add cypari2 ## Installing cypari2 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. 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) 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. 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_current - Install friction: medium - Maintenance: active - Downloads: 126.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags PARI/GP Python interface, number theory computation, polynomial factorization, algebraic number theory, PARI bindings Python, computational number theory, finite field arithmetic, number-theory, cryptography-research, computational-algebra [View on SkillFed](https://skillfed.io/packages/cypari2) · [View on PyPI](https://pypi.org/project/cypari2/)