ortools
Google OR-Tools python libraries and modules
What it is and what it does
OR-Tools is Google's open-source operations research library that bundles multiple specialized solvers for combinatorial optimization problems. It includes constraint programming solvers (CP-SAT and original CP), linear and mixed-integer programming optimizers (Glop and MPSolver wrappers), a vehicle routing library, and graph algorithms for shortest paths, min-cost flows, and assignments. The package wraps C++ implementations with Python bindings and depends on numpy, pandas, protobuf, absl-py, typing-extensions, and immutabledict for data handling and type support.
Developers use OR-Tools to model and solve real-world scheduling, routing, assignment, and resource allocation problems. It's particularly suited for problems where you need to optimize an objective function subject to constraints—typical in logistics, manufacturing, workforce scheduling, and network optimization. The library supports both commercial solvers (Gurobi, SCIP) and open-source alternatives (CBC, CLP, GLPK) through its MPSolver wrapper, giving flexibility in solver choice and licensing.
Use it for:
- Optimize vehicle routes for delivery or service networks with time windows and capacity constraints.
- Solve workforce scheduling problems to assign workers to shifts while respecting availability and skill requirements.
- Find optimal resource allocation in manufacturing or project management under budget and time constraints.
- Compute shortest paths, minimum-cost flows, or maximum flows in large graphs for network optimization.
- Model and solve bin packing, knapsack, or assignment problems in supply chain and logistics planning.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
OR-Tools provides constraint programming, linear and mixed-integer programming, vehicle routing, and graph algorithm solvers developed at Google for operations research problems.
Yes. OR-Tools is a mature, actively maintained library from Google with no known vulnerabilities, permissive licensing, and broad platform support. Install friction is moderate due to compiled components, but pre-built wheels cover common Python versions and architectures. It is the right choice for operations research and combinatorial optimization work, especially when you need multiple solver types or want to compare commercial and open-source solvers.
Install
ortools on PyPI
pip
pip install ortoolsuv
uv add ortoolspoetry
poetry add ortoolsInstalling ortools
Before you install
Medium install friction due to compiled C++ components across multiple Python versions and platforms. Active maintenance with recent commits and stable production status; 13896 repository stars indicate established community adoption.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most production and research applications.
Quickstart
pip install ortools
from ortools.linear_solver import pywraplp
solver = pywraplp.Solver.CreateSolver('GLOP')
if not solver:
print('Could not create solver')
Requires Python 3.9 or later; compiled wheels available for macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows (amd64).
Verify before relying
- Whether the package includes pre-built solvers (CBC, CLP, GLPK) or requires separate installation of commercial solvers like Gurobi or SCIP.
- Performance characteristics and scalability limits for large constraint programming or vehicle routing problems.
- Whether graph algorithm implementations are optimized for specific graph sizes or problem structures.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 6 — absl-py, numpy, pandas, protobuf, typing-extensions, immutabledict |
| Maintenance | actively maintained — 212 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,632,679/month — #1,879 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ortools-9.15.6755-cp310-cp310-macosx_10_15_x86_64.whl; ortools-9.15.6755-cp310-cp310-macosx_11_0_arm64.whl; ortools-9.15.6755-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; ortools-9.15.6755-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ortools-9.15.6755-cp310-cp310-win_amd64.whl; ortools-9.15.6755-cp311-cp311-macosx_10_15_x86_64.whl; ortools-9.15.6755-cp311-cp311-macosx_11_0_arm64.whl; ortools-9.15.6755-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; ortools-9.15.6755-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ortools-9.15.6755-cp311-cp311-win_amd64.whl; ortools-9.15.6755-cp312-cp312-macosx_10_15_x86_64.whl; ortools-9.15.6755-cp312-cp312-macosx_11_0_arm64.whl; ortools-9.15.6755-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; ortools-9.15.6755-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ortools-9.15.6755-cp312-cp312-win_amd64.whl; ortools-9.15.6755-cp313-cp313-macosx_10_15_x86_64.whl; ortools-9.15.6755-cp313-cp313-macosx_11_0_arm64.whl; ortools-9.15.6755-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; ortools-9.15.6755-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ortools-9.15.6755-cp313-cp313t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Keywords: operations research, constraint programming, linear programming, flow algorithms, python
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
PuLPPuLP is a linear and mixed-integer programming…
permissive · top 5,000 on PyPI
optlangOptlang formulates and solves linear,…
permissive · top 15,000 on PyPI
mipPython MIP models and solves mixed-integer…
copyleft · top 15,000 on PyPI
pyomoPyomo is a Python framework for formulating and…
permissive · top 5,000 on PyPI
POTPOT provides solvers for optimal transport…
permissive · top 15,000 on PyPI
lapxSolves linear assignment problems using…
permissive · top 15,000 on PyPI
python-constraintSolves constraint satisfaction problems (CSPs)…
permissive · top 15,000 on PyPI
cylpCyLP provides a Python interface to COIN-OR's…
copyleft · top 15,000 on PyPI
osqpOSQP is a Python wrapper for the Operator…
permissive · top 5,000 on PyPI
k-means-constrainedK-means clustering with enforced minimum and…
permissive · top 15,000 on PyPI