findiff
A Python package for finite difference derivatives in any number of dimensions.
What it is and what it does
findiff is a numerical differentiation library that applies finite difference stencils to numpy arrays to compute derivatives and solve PDEs. It lets you define derivative operators symbolically (e.g., d²/dx²) and apply them to data, with control over accuracy order, boundary handling, and grid periodicity. The package supports standard finite differences and newer compact (implicit) schemes that couple derivative values at neighboring points for spectral-like accuracy from small stencils.
You specify a grid spacing and derivative order, then apply the operator to your data. It handles multidimensional arrays, arbitrary linear combinations of derivatives with variable coefficients, and can return matrix representations of differential operators. Recent versions added periodic boundary conditions and compact schemes with automatic stencil selection, making it suitable for both simple derivative calculations and complex PDE solving workflows.
Use it for:
- Compute spatial derivatives on gridded data for physics simulations or numerical analysis.
- Solve time-dependent PDEs with Dirichlet or Neumann boundary conditions.
- Generate finite difference coefficient tables for custom numerical schemes.
- Build matrix representations of differential operators for linear algebra workflows.
- Apply compact finite differences to achieve high accuracy with narrow stencils on periodic or non-periodic grids.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes finite difference numerical derivatives and solves partial differential equations on arrays of any dimension, with support for arbitrary accuracy orders, boundary conditions, and compact (implicit) schemes.
Yes. findiff is actively maintained, has no known vulnerabilities, installs with low friction, and solves a clear problem in numerical computing. It is well-suited for anyone doing finite difference calculations or PDE solving in Python. The recent additions of compact schemes and periodic boundary conditions make it competitive for modern scientific computing tasks.
Install
findiff on PyPI
pip
pip install findiffuv
uv add findiffpoetry
poetry add findiffInstalling findiff
Before you install
Low friction: pure Python wheel with three well-established runtime dependencies (numpy, scipy, sympy). Actively maintained with recent commits and no known vulnerabilities.
License in practice
MIT license is permissive; you can use, modify, and distribute findiff with minimal restrictions, including in commercial projects.
Quickstart
pip install findiff
import numpy as np
from findiff import Diff
x = np.linspace(0, 1, 100)
f = np.sin(x)
d_dx = Diff(0, x[1] - x[0])
df_dx = d_dx(f)
Verify before relying
- Whether compact finite difference schemes (new in 0.13) offer measurable performance gains for typical PDE workloads compared to standard schemes.
- Scalability characteristics when applied to very large multidimensional arrays or high-order derivatives.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — numpy, scipy, sympy |
| Maintenance | actively maintained — 176 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 84,039/month — #14,033 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: findiff-0.13.1-py3-none-any.whl
Keywords: finite-differences, numerical-derivatives, scientific-computing
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
numdifftoolsComputes numerical derivatives, gradients,…
permissive · top 15,000 on PyPI
sparsediffpySparseDiffPy provides Python bindings to…
permissive · top 5,000 on PyPI
diffraxDiffrax provides numerical solvers for…
permissive · top 15,000 on PyPI
autograd-gammaProvides autograd-compatible derivatives for…
permissive · top 5,000 on PyPI
autogradAutograd automatically computes derivatives of…
permissive · top 5,000 on PyPI
torchcdeProvides differentiable GPU-capable solvers for…
permissive · top 15,000 on PyPI
nvidia-cusolver-cu11Provides NVIDIA CUDA solver native runtime…
unclear · top 5,000 on PyPI
torchsdeSolves stochastic differential equations (SDEs)…
permissive · top 5,000 on PyPI
casadiCasADi is a framework for algorithmic…
copyleft · top 5,000 on PyPI
nvidia-cusolverProvides CUDA solver native runtime libraries…
unclear · top 1,000 on PyPI