This release is a pre-release and may not be stable for production use.
geckopy
Enzyme-constrained genome-scale metabolic modelling in Python.
Full documentation for both MATLAB GECKO and geckopy — the six-stage protocol, installation, troubleshooting, and complete API reference — lives at gecko-docs.readthedocs.io. This README only covers install and a quick orientation; that site is the place to actually learn or look things up.
Disambiguation. This is a new, from-scratch port of the GECKO Toolbox (MATLAB). It is unrelated to the earlier and separate
geckopyPython package (on PyPI as release 2.0.2 and earlier) described in Carrasco Muriel, Long & Sonnenschein, Microbiology Spectrum 11(6):e01705-23 (2023), doi:10.1128/spectrum.01705-23.
What this is
Genome-scale metabolic models (GEMs) describe an organism's chemistry as a big network of reactions. A standard GEM lets each reaction run as fast as its substrates allow. In reality, enzymes catalyse those reactions, and each enzyme has a finite capacity (its kcat) and a finite supply (the cell's total protein budget). An ecModel (enzyme-constrained model) adds those limits to the network.
geckopy is a Python port of the GECKO Toolbox (MATLAB). It builds on cobrapy for the standard modelling layer, then layers GECKO's enzyme-constraint machinery on top: it fetches kcat values from BRENDA, predicts them with DLKcat, tunes them against experimental growth/flux data with CMA-ES, applies custom curations, and integrates proteomics measurements.
Status: beta (
4.0.0b1). All the MATLAB GECKO 3.2.5 functions used in the standard ecModel build are ported, and the yeast-GEM tutorial runs end-to-end. geckopy's major and minor version number (x.y.-) will follow the MATLAB GECKO numbering, justifying a jump to version 4.
Install
geckopy depends on raven-toolbox
(the Python port of the RAVEN Toolbox). Both are currently pre-releases on
PyPI, so a plain pip install geckopy will install the wrong version — --pre is
required:
pip install --pre geckopy
raven-toolbox doesn't need to be named separately: geckopy's own dependency
on it already specifies >=3.0.0b1, and a specifier that names a pre-release
opts pip into matching pre-releases for that package too, --pre or not. To
pin the exact versions this was written against instead of "whatever's
newest," name both explicitly:
pip install raven-toolbox==3.0.0b1 geckopy==4.0.0b1
Optional extras:
# Adds matplotlib (needed to render plots from the tutorial)
pip install --pre "geckopy[tutorial]"
# Adds cma (needed for CMA-ES kcat tuning, geckopy.kcat_tuning.evotune)
pip install --pre "geckopy[evotune]"
# Adds pytest + ruff (only needed if you're contributing)
pip install --pre "geckopy[dev]"
Requires Python 3.11 or newer.
Quick start
A minimal end-to-end build, assuming you have a project folder set up the
way the tutorial expects (model_adapter.toml + models/ + data/):
from geckopy import (
ModelAdapter,
load_conventional_gem,
load_uniprot_tsv,
make_ec_model,
save_ec_model,
)
# 1. The adapter holds organism-specific parameters (taxonomy id,
# biomass reaction, average enzyme saturation, etc.). They live in
# model_adapter.toml so they're easy to swap per organism.
adapter = ModelAdapter.from_folder("my_project")
# 2. Load the starting GEM (the regular metabolic model you want to
# extend) and a cached UniProt query (for enzyme MW and sequence).
model = load_conventional_gem(adapter)
uniprot = load_uniprot_tsv(adapter.params.path / "data" / "uniprot.tsv")
# 3. Build the ecModel. This adds protein pseudo-metabolites, a shared
# protein pool, and per-enzyme usage reactions on top of the GEM.
ec_model = make_ec_model(model, adapter, uniprot_db=uniprot)
# 4. Save in geckopy's YAML format.
save_ec_model(ec_model, "ecModel.yml", adapter=adapter)
Every public function (loaders, kcat fetchers, FBA/FVA helpers,
YAML I/O, ...) is reachable as from geckopy import X -- the
subpackages exist for code organisation but you don't have to use
them. See geckopy.__all__ for the full list (~80 names).
The full protocol (which adds kcat curation from BRENDA and DLKcat,
proteomics integration, and Crabtree-effect simulation) is in
tutorials/full_ecModel/protocol.py.
That script reproduces the MATLAB GECKO Nature Protocols tutorial in
Python, step by step, and is the easiest way to see geckopy in action.
Fitting kcats against measured growth rates and exchange fluxes (rather
than looking them up) is a separate workflow, geckopy.kcat_tuning.evotune
— see docs/evotune_kcat_tuning.md.
On-disk format
geckopy reads and writes ecModels as YAML: a canonical,
human-readable format that is a strict superset of cobrapy's YAML
schema, with three extra top-level keys for the ec data (ec-rxns,
ec-enzymes, gecko_light). Standard cobrapy tools (escher, memote,
...) can read the cobra portion and silently ignore the GECKO
extensions. The same format is read and written by MATLAB GECKO /
RAVEN, so ecModels exchange between the two toolboxes with no
translator. The schema and the parsing live in raven-toolbox.
See docs/yaml_format.md for the YAML
specification and how it differs from the legacy MATLAB / RAVEN format.
Relationship to MATLAB GECKO
geckopy is a function-by-function port: algorithmic fidelity comes
first, Pythonic idiom second. Each ported source file carries a
Ported from GECKO MATLAB: <path> docstring header. For current
MATLAB ↔ Python behavioural differences, see gecko-docs.readthedocs.io, the
shared documentation site for both toolboxes.
License
MIT. See LICENSE, or the license field of
pyproject.toml.
Release files for geckopy 4.0.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geckopy-4.0.0b1.tar.gz | 6.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geckopy-4.0.0b1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 MB
Release files / geckopy-4.0.0b1.tar.gz
| Download URL | geckopy-4.0.0b1.tar.gz |
|---|---|
| Size | 6.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bda424d9972a25bb729ed8a6e80c35736ed4b08ca9d99f1c8df1b3954f5848d8
|
|
BLAKE2b-256 checksum How to use checksums |
9c2a03417e5c261a0d8ca73d50c8bdd0ee76496291ffabd13fc9052e3b367b37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / geckopy-4.0.0b1-py3-none-any.whl
| Download URL | geckopy-4.0.0b1-py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aad835b1a66c3f10a6507d3e893ba73c98d01908517ccae3efea0a72b2912742
|
|
BLAKE2b-256 checksum How to use checksums |
a8c42f7bc7ff1dbcfb1ab6af4eb4fb44435a3014e9c6c6d297ca33c9f37ce83d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency log