skillfed

findiff

A Python package for finite difference derivatives in any number of dimensions.

findiff v0.13.1 84.0K downloads/30d#14,033 on PyPI508
Permissive license MIT Active released

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 findiff

uv

uv add findiff

poetry

poetry add findiff

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Mathematics

Tags

finite difference derivativesnumerical differentiationpartial differential equations solverfinite difference PDEmultidimensional derivativescompact finite differencesspectral-like resolution
numerical-methodspde-solverscientific-computing

More Mathematics packages