$npx skillfedfor your agent

linopy

Linear optimization with N-D labeled arrays in Python

Worth itPyPI MathematicsReleased Jul 2026134.2K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — linopy-0.9.0-py3-none-any.whl
v0.9.0 · released 2026-07-24 · Python >=3.11 · 11 runtime deps: numpy, scipy, bottleneck, toolz, numexpr, xarray, dask, polars

Yes. linopy is actively maintained, has low install friction, carries no known vulnerabilities, and offers a genuinely useful abstraction for optimization problems that naturally live in labeled arrays. Install it if you need to build optimization models with xarray-like data structures or if you want to avoid hand-coding matrix construction for multi-dimensional problems. The trade-off is that you must install a solver separately; linopy alone is only the modeling layer.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires an external solver (CBC, GLPK, HiGHS, SCIP, Gurobi, Xpress, Cplex, MOSEK, COPT, cuPDLPx, or Knitro) to be installed separately; linopy itself is only the modeling layer.
  • Low install friction with a pure-Python wheel distribution.
  • Active maintenance with a recent release (21 days old) and ongoing commits.

License · maintenance · safety

permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute linopy freely in commercial or private projects with minimal restrictions—only attribution and license inclusion required.

last release 2026-07-24 (21 days) · last repo commit 2026-08-13 · 253 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 134,199 downloads/mo, #11,485 on PyPI

Verify before relying

import linopy

m = linopy.Model()
apples = m.add_variables(lower=0, name="apples")
bananas = m.add_variables(lower=0, name="bananas")
m.add_constraints(3 * apples + 2 * bananas >= 8, name="daily_vitamins")
m.objective = apples + bananas
m.solve()
  • Performance comparison claims in the description refer to benchmarks not included in the fact sheet.
  • Whether lazy operations with dask scale effectively for very large problems is not quantified.
  • Solver selection and configuration details beyond the supported list are not documented in the excerpt.
Same gist for agents: .md · .json

What it is and what it does

linopy is a Python optimization modeling framework that lets you define linear, integer, mixed-integer, and quadratic programming problems using labeled n-dimensional arrays. It sits between data-handling libraries like xarray and external solvers, allowing you to express optimization constraints and objectives in a way that mirrors your data's natural structure—with coordinates like time, location, or consumer IDs—rather than flattening everything into matrices.

You define variables with bounds and coordinates, build constraints and objectives using arithmetic operations on those variables (with full broadcasting support), and then hand the model off to an external solver of your choice. linopy handles the translation to the solver's format and can import/export models via netCDF. It supports lazy evaluation with dask for large problems and is designed to make the optimization model transparent and easy to modify on the fly.

Use it for

  • Energy system planning: optimize generation and storage across time and regions with coordinate-based constraints.
  • Supply chain optimization: define inventory, production, and distribution variables indexed by product, location, and time period.
  • Resource allocation: minimize cost or maximize utility subject to constraints on budget, capacity, or demand across labeled dimensions.
  • Scheduling problems: model shift assignments or task scheduling using time and agent coordinates with linear constraints.
  • Portfolio optimization: construct investment problems with asset and time-period coordinates and quadratic objectives.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

linopy is actively maintained, has low install friction, carries no known vulnerabilities, and offers a genuinely useful abstraction for optimization problems that naturally live in labeled arrays. Install it if you need to build optimization models with xarray-like data structures or if you want to avoid hand-coding matrix construction for multi-dimensional problems. The trade-off is that you must install a solver separately; linopy alone is only the modeling layer.

Install

linopy on PyPI

Before you install

Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release (21 days old) and ongoing commits. Depends on well-established packages like numpy, scipy, xarray, and dask; no compiled system dependencies required by linopy itself.

Requires an external solver (CBC, GLPK, HiGHS, SCIP, Gurobi, Xpress, Cplex, MOSEK, COPT, cuPDLPx, or Knitro) to be installed separately; linopy itself is only the modeling layer.

License in practice

MIT license (permissive) means you can use, modify, and distribute linopy freely in commercial or private projects with minimal restrictions—only attribution and license inclusion required.

Quickstart

import linopy

m = linopy.Model()
apples = m.add_variables(lower=0, name="apples")
bananas = m.add_variables(lower=0, name="bananas")
m.add_constraints(3 * apples + 2 * bananas >= 8, name="daily_vitamins")
m.objective = apples + bananas
m.solve()

Verify before relying

  • Performance comparison claims in the description refer to benchmarks not included in the fact sheet.
  • Whether lazy operations with dask scale effectively for very large problems is not quantified.
  • Solver selection and configuration details beyond the supported list are not documented in the excerpt.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.11
Install frictionLow. Pure-Python wheel
Runtime dependencies
11 packages
numpyscipybottlenecktoolznumexprxarraydaskpolarstqdmdeprecationpackaging
MaintenanceActively maintained 21 days since the last release
Last repo commit
First released
Downloads134,199 / month, #11,485 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 3 - AlphaEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Typing :: Typed

Evidence: linopy-0.9.0-py3-none-any.whl

Tags

Capabilities
linear programming pythonoptimization with xarrayinteger programming solverconstraint optimization arraysmixed-integer programmingquadratic programming pythonoptimization labeled variables
Topics
optimizationlinear-programmingxarray-native

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 › “optimization with xarray”

  • linopylinopy builds linear, integer, and quadratic optimization models…
  • pystac-ext-xarray-assetsExtends PySTAC to support the Xarray Assets Extension specification,…
  • xprojXProj is an Xarray extension that provides tools for managing…

Give your agent the search over MCP, or paste the wish link into any chat.

More Mathematics packages

networkx Worth it
PyPI · Python Modules · released Dec 2025

NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.

BSD-3-Clausepure Python
290.9Mdownloads / mo
kiwisolver Worth it
PyPI · Mathematics · released Mar 2026

kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.

Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.

BSD-3-Clausecompiled wheel · 3.10+
205.5Mdownloads / mo
sympy Worth it
PyPI · Scientific/Engineering · released Apr 2025

SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.

BSD-3-Clausepure Python · 3.9+
196.4Mdownloads / mo
contourpy Worth it
PyPI · Information Analysis · released Jul 2025

ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.

BSD-3-Clausecompiled wheel · 3.11+
191.2Mdownloads / mo
torch With conditions
PyPI · Software Development · released Jul 2026

PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.

Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND MITcompiled wheel · 3.10+
102.5Mdownloads / mo
onnxruntime Worth it
PyPI · Software Development · released Jul 2026

onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.

Install it if you have ONNX models to run in production or development.

MITcompiled wheel · 3.11+
89.3Mdownloads / mo

See also mip · PuLP · xarray-einstats · xarray · optlang · cvxpy · amplpy · cobra · cvxopt · xpress