skillfed

pyroots

Pure python single variable function solvers

pyroots v0.5.0 122.8K downloads/30d#11,935 on PyPI7
Permissive license BSD-3-Clause Abandoned released

What it is and what it does

Pyroots is a pure-Python library that finds roots of single-variable functions using classical numerical methods: bisection, Ridder's method, and Brent's method (with two variants). It exists as a lightweight alternative to scipy, requiring no compiled dependencies and fitting easily into standalone projects or bundled applications. The library provides a unified API across all solvers, letting you switch methods by changing a single import.

You define a function taking at least one argument (the variable), specify an interval containing the root, and call the solver. It returns a result object with the root value, convergence status, iteration count, function call count, and the sequence of steps taken. The main design advantage is explicit control over precision via epsilon—you specify exactly how many digits of accuracy you want, avoiding unnecessary function evaluations that scipy might perform.

Use it for:

  • Embedded applications or py2exe bundles where scipy's size is prohibitive and you need lightweight root-finding.
  • Expensive function evaluations (seconds or minutes per call) where scipy's over-convergence wastes computation.
  • Educational projects or numerical analysis teaching where you want transparent, readable solver implementations.
  • Standalone tools that need root-finding without pulling in a large scientific stack.
  • Functions with keyword arguments that scipy's API doesn't handle conveniently.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Implements root-finding algorithms (bisect, ridder, Brent) for single-variable functions without requiring scipy as a dependency.

No—not for new projects. The package is abandoned (last update 2020-06-17, no maintenance since). While the code is simple and low-friction, scipy is now the standard, well-maintained alternative for root-finding. Use pyroots only if you have a specific constraint (extreme size limits, legacy py2exe bundling) that scipy cannot meet and you are willing to maintain a dormant dependency yourself.

Install

pyroots on PyPI

pip

pip install pyroots

uv

uv add pyroots

poetry

poetry add pyroots

Installing pyroots

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2020-06-17 and no commits since then. Maintenance status is a significant concern for long-term reliability.

License in practice

BSD-3-Clause is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute pyroots freely provided you retain the license notice.

Quickstart

pip install pyroots

from pyroots import Brentq

def f(x, a):
    return x ** 2 - a + 1

solver = Brentq(epsilon=1e-5)
result = solver(f, -3, 0, a=2)
print(result.x0, result.convergence)

You must provide an interval [xa, xb] that brackets the root (f(xa) and f(xb) must have opposite signs for most methods).

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.8 given its abandoned status.
  • Real-world performance comparison with scipy's root-finding methods on expensive function evaluations.
  • Whether the claimed advantage of bundling with py2exe or similar tools remains practical in modern deployment workflows.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,249 days since the last release
Last repo commit
First released
Downloads 122,766/month — #11,935 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyroots-0.5.0-py2.py3-none-any.whl

Keywords: numeric analysis, brent, bisect, ridder, solver, univariate

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

root finding single variablenumerical solver bisect brentunivariate equation solverlightweight root finderscipy alternative root findingbrent ridder bisect algorithmfunction root locator
numerical-methodsabandoned-maintenance

More Libraries packages