cobra
COBRApy is a package for constraint-based modeling of metabolic networks.
Decision gist · record as of 2026-08-14
Yes. COBRApy is production-stable (active maintenance, release 3 days old, 579 GitHub stars) with low install friction and no known vulnerabilities. The dual GPL/LGPL copyleft license requires source disclosure but is standard for academic bioinformatics. Install if you need genome-scale metabolic modeling; the twelve runtime dependencies are justified by the package's scope and are well-maintained.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a compatible mathematical solver (CPLEX, Gurobi, or GLPK via swiglpk) to be installed or configured for optimization to work.
- Low install friction with a pure-wheel distribution.
- Active maintenance with a release 3 days old and recent commits.
License · maintenance · safety
copyleft license (copyleft) — Dual-licensed under LGPL-2.0-or-later or GPL-2.0-or-later (copyleft). You may choose which license to use, but either choice requires source disclosure and derivative work licensing under the same terms.
last release 2026-08-11 (3 days) · last repo commit 2026-08-11 · 579 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 91,149 downloads/mo, #13,535 on PyPI
Alternatives
Verify before relying
pip install cobra
import cobra
model = cobra.io.read_sbml_model('model.xml')
solution = model.optimize()- Whether all 12 runtime dependencies are required for basic usage or only for specific features (e.g., array support for MATLAB models).
- Performance characteristics and scalability limits for large genome-scale models.
- Compatibility with specific solver versions beyond the general optlang interface.
What it is and what it does
COBRApy is a Python framework for building and analyzing constraint-based models of metabolic networks at genome scale. It provides infrastructure for creating metabolic models, managing reactions and metabolites, and accessing mathematical solvers (CPLEX, Gurobi, GLPK) through the optlang interface. The package implements standard COBRA methods including flux balance analysis (FBA), flux variability analysis (FVA), and gene deletion simulations to predict metabolic behavior and gene essentiality.
The package is designed as both a standalone tool and a foundation for building specialized COBRA-related Python packages. It depends on numpy for numerical computation, pandas for data manipulation, pydantic for model validation, and python-libsbml for reading SBML model files. Solvers are accessed through optlang, with GLPK automatically available via swiglpk. The package targets researchers in systems biology, metabolic engineering, and computational biology who need to model and analyze organism metabolism at scale.
Use it for
- Predict metabolic flux distributions and growth rates under different nutrient conditions using flux balance analysis.
- Identify essential genes by simulating single and multiple gene knockouts to assess impact on growth.
- Perform flux variability analysis to determine the range of possible reaction rates consistent with optimal growth.
- Load, modify, and validate genome-scale metabolic models in SBML format for strain design workflows.
- Build custom analysis pipelines by extending COBRApy classes for domain-specific metabolic research.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
COBRApy is production-stable (active maintenance, release 3 days old, 579 GitHub stars) with low install friction and no known vulnerabilities. The dual GPL/LGPL copyleft license requires source disclosure but is standard for academic bioinformatics. Install if you need genome-scale metabolic modeling; the twelve runtime dependencies are justified by the package's scope and are well-maintained.
Install
cobra on PyPI
Before you install
Low install friction with a pure-wheel distribution. Active maintenance with a release 3 days old and recent commits. Twelve runtime dependencies including numpy, pandas, optlang, and swiglpk introduce some complexity, but the package is production-stable.
Requires a compatible mathematical solver (CPLEX, Gurobi, or GLPK via swiglpk) to be installed or configured for optimization to work.
License in practice
Dual-licensed under LGPL-2.0-or-later or GPL-2.0-or-later (copyleft). You may choose which license to use, but either choice requires source disclosure and derivative work licensing under the same terms.
Quickstart
pip install cobra
import cobra
model = cobra.io.read_sbml_model('model.xml')
solution = model.optimize()
Verify before relying
- Whether all 12 runtime dependencies are required for basic usage or only for specific features (e.g., array support for MATLAB models).
- Performance characteristics and scalability limits for large genome-scale models.
- Compatibility with specific solver versions beyond the general optlang interface.
Package facts
| License | copyleft license copyleft |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 12 packagesappdirsdepinfofuturehttpxnumpyoptlangpandaspydanticpython-libsbmlrichruamel.yamlswiglpk |
| Maintenance | Actively maintained 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 91,149 / month, #13,535 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Natural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: Bio-Informatics |
Evidence: cobra-0.32.1-py2.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 › “metabolic network modeling”
- cobraCOBRApy is a constraint-based modeling package for genome-scale…
- dash-cytoscapeDash Cytoscape wraps Cytoscape.js to let you build interactive…
- pyats.topologyModels network testbeds, devices, interfaces, links and segments as…
Give your agent the search over MCP, or paste the wish link into any chat.
More Bio-Informatics packages
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.
Biopython provides Python tools for computational molecular biology, including sequence analysis, structure parsing, database access, and phylogenetic tree manipulation.
However, verify that the custom Biopython License Agreement aligns with your project's licensing requirements before committing to it in production or proprietary work.
Client library for the Firecrawl API that scrapes, crawls, and searches the web, returning clean Markdown or structured data; also indexes research papers from PubMed, bioRxiv, medRxiv, and arXiv.
A self-balancing interval tree data structure that stores and queries overlapping or enveloped ranges, supporting point lookups, range overlaps, and range envelopment queries.
Install it if you need to store and query overlapping or enveloped ranges; the self-balancing design and rich query interface make it significantly easier than…
Albumentations applies image transformations to training data, supporting classification, segmentation, object detection, and pose estimation with a unified API for images, masks, bounding boxes, and keypoints.
Install it if you need a unified, production-grade augmentation API for computer vision tasks.
PubChemPy is a Python wrapper around the PubChem REST API that lets you search for chemical compounds by name, substructure, or similarity, retrieve their properties, and convert between chemical file formats.
Install it if you need programmatic access to PubChem data.
See also cvxpy · swiglpk · pyomo · scanpy · optlang · linopy · cvxopt · gseapy · PuLP · docplex