better-optimize
A drop-in replacement for scipy optimize functions with quality of life improvements
Decision gist · record as of 2026-08-14
Yes, if you regularly use scipy's optimize functions and want cleaner syntax, progress visibility, and unified callbacks. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe addition. Best suited for interactive work and research; production code that calls scipy directly may not need the wrapper overhead.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.12 or later.
- Low friction: pure Python wheel with standard scientific dependencies (numpy, scipy, rich, joblib, pandas, threadpoolctl).
- Active maintenance with recent releases.
License · maintenance · safety
MIT License (permissive) — MIT License permits commercial and private use with minimal restrictions; attribution required but no copyleft obligations.
last release 2026-05-23 (83 days) · last repo commit 2026-05-23 · 7 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 206,389 downloads/mo, #9,574 on PyPI
Alternatives
Verify before relying
pip install better_optimize
import numpy as np
from better_optimize import minimize
def rosenbrock(x):
return sum(100.0*(x[1:] - x[:-1]**2.0)**2.0 + (1 - x[:-1])**2.0)
result = minimize(
rosenbrock,
x0=np.array([-1.0, 2.0]),
method="L-BFGS-B",
tol=1e-6,
maxiter=1000,
progressbar=True,
)- Whether progress bar display works correctly in all headless/non-terminal environments as claimed.
- Performance overhead of the wrapper layer relative to direct scipy calls for large-scale problems.
- Compatibility of fused function detection with all scipy optimizer variants.
What it is and what it does
better_optimize is a convenience layer over scipy's optimization routines that reduces boilerplate and adds visibility into long-running solves. It replaces scipy's nested `options` dictionaries with flat keyword arguments, normalizes callback signatures across different optimizers (minimize, root, basinhopping, differential_evolution), and provides optional rich progress bars showing iteration counts, elapsed time, objective values, and gradient/Hessian norms. It also handles fused objective functions that return multiple values (loss, gradient, Hessian) together, caching intermediate results to avoid redundant computation.
The package includes multi_optimize for parallel optimization from multiple starting points using different initialization strategies (uniform, normal, Sobol, Latin hypercube) and backends (sequential, loky, threading). It depends on numpy, scipy, rich, joblib, pandas, and threadpoolctl. Early stopping is supported by raising StopOptimization from a callback, and all results are standard scipy OptimizeResult objects, so downstream code needs no changes.
Use it for
- Minimize a function with a live progress bar to monitor convergence without blocking output.
- Run the same callback logic across minimize, root, and basinhopping without rewriting for each method's signature.
- Optimize a triple-fused objective that computes value, gradient, and Hessian together, avoiding redundant computation.
- Search for the global minimum by launching many local optimizations in parallel from random starting points.
- Stop an optimization early when a target loss is reached, returning the best result so far.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you regularly use scipy's optimize functions and want cleaner syntax, progress visibility, and unified callbacks.
The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe addition. Best suited for interactive work and research; production code that calls scipy directly may not need the wrapper overhead.
Install
better-optimize on PyPI
Before you install
Low friction: pure Python wheel with standard scientific dependencies (numpy, scipy, rich, joblib, pandas, threadpoolctl). Active maintenance with recent releases.
Requires Python 3.12 or later.
License in practice
MIT License permits commercial and private use with minimal restrictions; attribution required but no copyleft obligations.
Quickstart
pip install better_optimize
import numpy as np
from better_optimize import minimize
def rosenbrock(x):
return sum(100.0*(x[1:] - x[:-1]**2.0)**2.0 + (1 - x[:-1])**2.0)
result = minimize(
rosenbrock,
x0=np.array([-1.0, 2.0]),
method="L-BFGS-B",
tol=1e-6,
maxiter=1000,
progressbar=True,
)
Verify before relying
- Whether progress bar display works correctly in all headless/non-terminal environments as claimed.
- Performance overhead of the wrapper layer relative to direct scipy calls for large-scale problems.
- Compatibility of fused function detection with all scipy optimizer variants.
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesnumpyscipyrichthreadpoolctljoblibpandas |
| Maintenance | Actively maintained 83 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 206,389 / month, #9,574 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Mathematics |
Evidence: better_optimize-0.4.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “scipy optimize wrapper”
- better-optimizeA wrapper around scipy's optimize.minimize and optimize.root that…
- osqpOSQP is a Python wrapper for the Operator Splitting Quadratic Program…
- roptropt is a Python module for running robust optimization workflows,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also scikit-optimize · optlang · autograd · directsearch · progress · ropt · optax · amplpy · xpresslibs