Python packages for mathematics, from algebra and analysis to geometry, statistics, optimization, and topology.
Contributions are welcome! Read the contribution guidelines first.
- Algebra
- Analysis
- Animations and Images
- Dynamical Systems
- General Mathematics
- Geometry
- Graph Theory
- Group Theory
- Learning Math
- Linear Algebra
- Number Theory
- Optimization
- Probability and Statistics
- Topology
- Others
- clifford - Geometric Algebra (Clifford algebra) for Python.
- fxpmath - A Python library for fractional fixed-point (base 2) arithmetic and binary manipulation.
- galgebra - Symbolic Geometric Algebra/Calculus package for SymPy.
- Galois - A performant NumPy extension for Galois fields and their applications.
- kingdon - A symbolically optimized Geometric Algebra library with PyTorch/NumPy/SymPy compatibility and ganja.js visualization.
- pixell - A rectangular pixel map manipulation and harmonic analysis library derived from Sigurd Naess' enlib.
- Plabic - Cluster algebraic/geometric structures related to plabic graphs.
- PyQuaternion - A fully featured, pythonic library for representing and using quaternions.
- multivar_horner - Python package implementing a multivariate Horner scheme for efficiently evaluating multivariate polynomials.
- Quaternion - Add built-in support for quaternions to NumPy.
- chaospy - Toolbox for performing uncertainty quantification with polynomial chaos expansions.
- chebpy - A Python implementation of Chebfun.
- dedalus - A flexible framework for solving PDEs with modern spectral methods.
- devito - DSL and compiler framework for automated finite-differences and stencil computation.
- diffrax - Numerical differential equation solvers in JAX; autodifferentiable and GPU-capable.
- dolfinx - Next generation FEniCS problem solving environment for solving PDEs with the finite element method.
- findiff - Python package for numerical derivatives and partial differential equations in any number of dimensions.
- FiPy - A finite volume PDE solver written in Python.
- firedrake - An automated system for the portable solution of partial differential equations using the finite element method.
- foof - Parameterizing neural power spectra into periodic & aperiodic components.
- harmonica - Forward modeling, inversion, and processing gravity and magnetic data.
- MutatorMath - Python library for piecewise linear interpolation in multiple dimensions with multiple, arbitrarily placed, masters.
- NGSolve - High performance multiphysics finite element software with a flexible Python interface.
- numdifftools - Solve automatic numerical differentiation problems in one or more variables.
- PyAbel - A Python package for Abel and inverse Abel transforms.
- pyFFTW - A pythonic wrapper around FFTW, the fast Fourier transform library.
- pykoopman - A package for computing data-driven approximations to the Koopman operator.
- py-pde - Python package for solving partial differential equations using finite differences.
- PyWavelets - Wavelet transforms in Python.
- quadpy - Numerical integration (quadrature, cubature) in Python.
- scikit-fem - Simple finite element assemblers.
- scikit-fmm - A Python extension module implementing the fast marching method.
- sfepy - Software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 1D, 2D and 3D.
- SHTOOLS - Spherical Harmonic Tools.
- torchdiffeq - Differentiable ODE solvers with full GPU support and O(1)-memory backpropagation.
- torchquad - Numerical integration in arbitrary dimensions on the GPU using PyTorch / TF / JAX.
- Hyperbolic wythoff - Draw the Wythoff construction of uniform tilings in hyperbolic plane.
- ManimGL - 3Blue1Brown's animation engine for explanatory math videos.
- Manim - A community-maintained Python framework for creating mathematical animations.
- dysts - A database of hundreds of chaotic systems and strange attractors.
- jitcdde - Just-in-time compilation for delay differential equations.
- jitcode - Just-in-time compilation for ordinary differential equations.
- nolds - Nonlinear measures for dynamical systems (Lyapunov exponents, correlation dimension, Hurst exponent, ...).
- parcels - Main code for Parcels (Probably A Really Computationally Efficient Lagrangian Simulator).
- PyDMD - Dynamic Mode Decomposition in Python.
- PyNamical - Modeling and visualizing discrete nonlinear dynamical systems, chaos, and fractals.
- PySINDy - Sparse identification of nonlinear dynamical systems from data.
- AxiomPy - A Python library for advance mathematics operations.
- cypari2 - Python interface to the number theory library PARI/GP.
- diofant - A Python computer algebra system (CAS), originally a fork of SymPy.
- gmpy2 - General multiple-precision arithmetic for Python (GMP, MPFR, MPC).
- Mathics - A free, general-purpose computer algebra system featuring Wolfram Language compatibility.
- mpmath - A Python library for arbitrary-precision floating-point arithmetic.
- passagemath - A modularized, pip-installable fork of SageMath.
- pymbolic - A simple package to do symbolic math (focus on code generation and DSLs).
- Sage - SageMath, a free open-source mathematics software system (computer algebra system).
- SciPy - Open-source software for mathematics, science, and engineering, with modules for statistics, optimization, integration, linear algebra, Fourier transforms, signal and image processing, ODE solvers, and more.
- SimPy - A computer algebra system written in pure Python.
- SymEngine - Python wrappers for SymEngine, a fast symbolic manipulation library written in C++.
- boule - Reference ellipsoids for geodesy and geophysics.
- CGAL bindings - Python bindings for CGAL, the Computational Geometry Algorithms Library.
- COMPAS - Core library of the COMPAS framework for research in architecture, engineering and digital fabrication.
- geomstats - Computations and statistics on manifolds with geometric structures.
- gpytoolbox - A collection of utility functions to prototype geometry processing research in Python.
- libigl - Python bindings for libigl, a geometry processing library.
- Manifold - Geometry library for topologically robust mesh Boolean operations.
- NURBS-Python - Object-oriented pure Python B-Spline and NURBS library.
- polytope - Geometric operations on polytopes of any dimension.
- potpourri3d - 3D geometry tools in Python: geodesic distances, heat methods, mesh and point cloud processing.
- pymanopt - Python toolbox for optimization on Riemannian manifolds with support for automatic differentiation.
- pytransform3d - 3D transformations for Python.
- roma - A lightweight library to deal with 3D rotations in PyTorch.
- shapely - Manipulation and analysis of geometric objects in the Cartesian plane.
- trimesh - Python library for loading and using triangular meshes.
- cuGraph - RAPIDS GPU-accelerated graph analytics library.
- EasyGraph - A network analysis library covering structural hole spanners, network embedding, and classic network analysis.
- GraKeL - A scikit-learn compatible library for graph kernels.
- graph-theory - A simple graph library.
- graphblas-algorithms - Graph algorithms written in GraphBLAS.
- Graphillion - Fast, lightweight library for operations on huge sets of graphs.
- networkit - A toolkit for large-scale network analysis.
- networkx - Creation, manipulation, and study of the structure, dynamics and functions of complex networks.
- PrRGG - Python Random Graph Generator.
- python-igraph - Python interface for the igraph high-performance graph library.
- rustworkx - A high-performance Python graph library implemented in Rust.
- bella - New computational package for small-rank matrix groups.
- e3nn - A modular framework for neural networks with Euclidean symmetry (irreducible representations of O(3)).
- jaxlie - Rigid transforms and Lie groups (SO(2), SE(2), SO(3), SE(3)) for JAX.
- Liegroups - Python implementation of SO2, SE2, SO3, and SE3 matrix Lie groups using NumPy or PyTorch.
- manif - A small library for Lie theory with Python bindings.
- Permuta - A native Python library for permutation pattern research.
- Permutation - Permutations of finitely many positive integers.
- spglib - A library for finding and handling crystal symmetries (space groups).
- spgrep - On-the-fly generator of space-group irreducible representations.
- symmetria - An intuitive, thorough, and comprehensive framework for interacting with the symmetric group and its elements.
- MathGenerator - A math problem generator, created for the purpose of giving teachers and students the means to easily get access to random math exercises to suit their needs.
- PyWonderland - A tour in the wonderland of math with Python.
- CoLA - Compositional linear algebra for large-scale structured matrices.
- lineax - Linear solvers in JAX and Equinox.
- matfree - Matrix-free linear algebra in JAX.
- NumPy - The fundamental package for scientific computing with Python.
- opt_einsum - Optimizing einsum functions in NumPy, TensorFlow, Dask, and more with contraction order optimization.
- PyAMG - Algebraic multigrid solvers in Python.
- python-graphblas - Python library for GraphBLAS: high-performance sparse linear algebra for scalable graph analytics.
- scikit-sparse - Sparse matrix tools extending scipy.sparse (CHOLMOD sparse Cholesky decomposition).
- sparse - Multi-dimensional sparse arrays for the PyData ecosystem.
- Spatial Maths for Python - Create, manipulate and convert representations of position and orientation in 2D or 3D using Python.
- PentaPy - A Python toolbox for pentadiagonal linear systems.
- PyLops - A Linear-Operator Library for Python.
- PyParadiso - Python interface to the Intel MKL Pardiso library to solve large sparse linear systems of equations.
- Poisson-solver-2D - Finite difference solution of 2D Poisson equation. Can handle Dirichlet, Neumann and mixed boundary conditions.
- scikit-spatial - Spatial objects and computations based on NumPy arrays.
- TensorLy - Tensor decomposition, tensor algebra and tensor regression in Python.
- continuedfractions - Object-oriented continued fractions with Python.
- primesieve-Python - Fast prime number generator. Python bindings for the primesieve C++ library.
- pyadic - P-Adic numbers and finite fields in Python.
- python-flint - Python bindings for FLINT (Fast Library for Number Theory) and Arb.
- oeis - Newcomer friendly project implementing a few oeis.org sequences.
- BayesianOptimization - A Python implementation of global optimization with Gaussian processes.
- BoTorch - Bayesian optimization in PyTorch.
- CasADi - A symbolic framework for numeric optimization with algorithmic differentiation.
- CVXOPT - Python software for convex optimization.
- cvxpy - A Python-embedded modeling language for convex optimization problems.
- DEAP - Distributed Evolutionary Algorithms in Python.
- GEKKO - Optimization suite for mixed-integer, nonlinear and dynamic optimization.
- HiGHS - High performance linear, mixed-integer and quadratic optimization software with a Python interface (highspy).
- linopy - Linear optimization with N-D labeled arrays in Python.
- Nevergrad - A Python toolbox for gradient-free optimization.
- NLopt - A library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained optimization.
- optax - A gradient processing and optimization library for JAX.
- optimistix - Nonlinear optimisation (root-finding, least squares, minimisation) in JAX and Equinox.
- OR-Tools - Google's operations research tools for combinatorial optimization, linear programming and constraint programming.
- OSQP - Python interface for OSQP, the Operator Splitting Quadratic Program solver.
- PuLP - A Python linear programming API.
- pymoo - Multi-objective optimization in Python (NSGA-II, NSGA-III, MOEA/D, and more).
- Pyomo - An object-oriented algebraic modeling language in Python for structured optimization problems.
- PySCIPOpt - Python interface for the SCIP Optimization Suite.
- Python-MIP - Python tools for the modeling and solution of mixed-integer linear programs.
- qpsolvers - Quadratic programming solvers in Python with a unified API.
- arch - Autoregressive conditional heteroskedasticity (ARCH) and other volatility models in Python.
- ArviZ - Exploratory analysis of Bayesian models.
- Bambi - BAyesian Model-Building Interface (Bambi) in Python.
- BlackJAX - A Bayesian inference library designed for ease of use, speed and modularity.
- CmdStanPy - A lightweight Python interface to Stan.
- dynesty - Dynamic nested sampling package for computing Bayesian posteriors and evidences.
- emcee - The Python ensemble sampling toolkit for affine-invariant MCMC.
- GPJax - Gaussian processes in JAX and Equinox.
- icepool - Python dice probability package.
- lifelines - Survival analysis in Python.
- linearmodels - Instrumental variable and panel data models missing from statsmodels.
- lmfit - Non-linear least-squares minimization and curve fitting.
- NumPyro - Probabilistic programming with NumPy powered by JAX for autograd and JIT compilation.
- obscure_stats - A small collection of lesser-known statistical measures.
- OpenTURNS - Probabilistic modelling and uncertainty quantification library.
- particles - Sequential Monte Carlo in Python.
- pgmpy - Python toolkit for causal and probabilistic reasoning with graphical models.
- Pingouin - Statistical package in Python based on Pandas.
- pomegranate - Fast, flexible and easy to use probabilistic modelling in Python.
- PyAutoFit - Classy probabilistic programming.
- pyGAM - Generalized Additive Models in Python.
- PyMC - Bayesian modeling and probabilistic programming in Python.
- Pyro - Deep universal probabilistic programming with Python and PyTorch.
- SALib - Sensitivity analysis library in Python (Sobol, Morris, FAST, and other methods).
- sbi - A Python package for simulation-based inference.
- scikit-posthocs - Multiple pairwise comparisons (post hoc) tests in Python.
- Statsmodels - Statistical modeling and econometrics in Python.
- thejoker - A custom Monte Carlo sampler for the (gravitational) two-body problem.
- UltraNest - Fit and compare complex models reliably and rapidly with advanced nested sampling.
- Dionysus - Library for computing persistent homology.
- GUDHI - A generic library with a Python interface for topological data analysis and higher-dimensional geometry.
- kepler-mapper - A flexible Python implementation of the Mapper algorithm for topological data analysis.
- persim - Distances and representations of persistence diagrams.
- Regina - Software for low-dimensional topology: 3-manifolds, 4-manifolds, knots and normal surfaces.
- ripser.py - A lean persistent homology library for Python.
- scikit-tda - Topological data analysis for Python.
- SnapPy - A package for studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures.
- Spherogram - Planar diagrams arising in 3-dimensional topology, such as link and Heegaard diagrams.
- TopoNetX - Computing on topological domains: simplicial, cell and combinatorial complexes.
- autograd - Efficiently computes derivatives of NumPy code.
- Axelrod - A research tool for the Iterated Prisoner's Dilemma and other game-theoretic tournaments.
- Gambit - Software tools for computation in game theory.
- handcalcs - Convert Python calculations into rendered LaTeX.
- LaTeX-OCR - Convert images of equations into LaTeX code using a vision transformer.
- LeanDojo - Tool for data extraction and interacting with the Lean theorem prover programmatically.
- MathTranslate - Translate scientific papers with math.
- Nashpy - A Python library for the computation of equilibria of 2-player strategic games.
- Pint - Operate and manipulate physical quantities (units of measurement) in Python.
- portion - Data structure and operations for intervals.
- PySAT - A toolkit for SAT-based prototyping in Python.
- pySMT - A library for SMT formulae manipulation and solving.
- PySymmPol - Manipulation of various symmetric polynomials, and Young diagrams.
- quicktions - Fast fractions reimplementation in Cython.
- uncertainties - Transparent calculation of uncertainties (error propagation) on the quantities involved.
- unyt - Handle, manipulate, and convert data with units in Python.
- Z3 - The Z3 theorem prover, with a Python API.
Packages that are archived, no longer available, or without activity in the last two years are listed in unmaintained.md.