PyEnzyme
PyEnzyme is the interface to the data model EnzymeML and offers a convenient way to document and model research data. Lightweight syntax for rapid development of data management solution in enzymology and biocatalysis.
🧬 Features
- Reproducible documentation of enzymatic and biocatalytic experiments.
- Import from and export to the SBML-based markup language EnzymeML and more.
- Fetch entities from CheBI, UniProt, PubChem, RHEA and PDB databases.
- Visualize experimental results for inspection and publication.
⚡️ Quick start
Get started with PyEnzyme by running the following command
# Using PyPI
python -m pip install pyenzyme
Or build by source
git clone https://github.com/EnzymeML/PyEnzyme.git
cd PyEnzyme
python3 setup.py install
🚀 Try PyEnzyme in Google Colab
Get hands-on experience with PyEnzyme without any local installation! Try our interactive Google Colab notebook by clicking the badge below:
⚙️ Package Options
PyEnzyme comes with many flavors, choose whether you want only the base installation, the modeling package or all of it using the following options.
# PySCeS - modeling
python -m pip install "pyenzyme[pysces]"
📖 Documentation
For further documentation on how to use PyEnzyme, please refer to the documentation. Here you will find detailed guides on how to use PyEnzyme effectively and efficiently.
⚙️ Example code
This example will demonstrate how to create a simple EnzymeML document using PyEnzyme and how to use initializers from official databases Chebi and UniProt to gather metadata.
Create a simple EnzymeML document
import pyenzyme as pe
# Create a simple EnzymeML document
enzmldoc = pe.EnzymeMLDocument(name="Test")
vessel = enzmldoc.add_to_vessels(
id="vessel_1",
name="Vessel 1",
volume=1.0,
unit="l", # Units are automatically converted to a UnitDefinition
)
# Add a protein from UniProt
protein = pe.fetch_uniprot("P07327", vessel_id=vessel.id)
enzmldoc.proteins.append(protein)
# Add a reaction from RHEA DB
reaction, participants = pe.fetch_rhea("RHEA:22864", vessel_id=vessel.id)
enzmldoc.small_molecules += participants
enzmldoc.reactions.append(reaction)
# Parse a tabular file to a measurement
measurements = pe.from_excel(
path="measurements.xlsx",
data_unit="mmol / l",
time_unit="h",
)
enzmldoc.measurements += measurements
# Serialize to EnzymeML
pe.write_enzymeml(enzmldoc, "enzmldoc.json")
# Deserialize from EnzymeML
enzmldoc = pe.read_enzymeml("enzmldoc.json")
# Convert to SBML
sbml_doc = pe.to_sbml(enzmldoc, "enzmldoc.omex")
(Code should run as it is)
Compose an EnzymeML document
As an alternative to the manual creation of an EnzymeML document, you can use the compose function to create an EnzymeML document from a list of identifiers. This function will fetch the corresponding entities from the official databases and compose an EnzymeML document. Duplicate entities are removed to avoid redundancy.
import pyenzyme as pe
doc = pe.compose(
name="test",
proteins=["PDB:1A23"],
small_molecules=["CHEBI:32551"],
reactions=["RHEA:22864"],
)
pe.write_enzymeml(doc, "enzmldoc.json")
(Code should run as it is)
Please note, that by providing RHEA identifiers, the function will automatically fetch all associated CheBI molecules that are part of the reaction.
📖 Documentation and more examples
Explore all the features of PyEnzyme in our documentation and take part in Discussions and/or Issues.
🔙 Backwards compatibility
For backward compatibility with previous versions of PyEnzyme, this release includes the original v1.1.5 version of the package under the v1 subpackage. Users may continue to utilize the legacy API by importing from pyenzyme.v1 instead of pyenzyme. Please be aware that the dependencies for the current v2 implementation differ from those of v1 and must be installed separately using poetry install --with v1.
For new projects, we recommend utilizing the updated API available in the package root. Existing users of the legacy API are encouraged to migrate to the current version to benefit from the latest features and improvements.
🧪 Testing
Contributors should install the pre-commit hooks once per clone (keeps uv.lock in sync and runs the linter before each commit):
uv tool install pre-commit
pre-commit install
In order to run tests there are two different ways. First you can utilize pytest directly by running the following:
python -m pytest -vv
Or you can the provided Dockerfile to run the tests in a containerized environment.
docker build -t pyenzyme .
docker run pyenzyme
⚠️ License
PyEnzyme is free and open-source software licensed under
the BSD 2-Clause License.
Metadata
Release files for pyenzyme 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyenzyme-2.3.0.tar.gz | 1.8 MB | Without provenance | Details for pyenzyme-2.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyenzyme-2.3.0-py3-none-any.whl | Python 3 | none | any | Details for pyenzyme-2.3.0-py3-none-any.whl |
Total release size: 2.0 MB
Release files / pyenzyme-2.3.0.tar.gz
| Download URL | pyenzyme-2.3.0.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
888ec44a9f4a60175823952f10e968bf2e454688ce5e750504c826607cc64433
|
|
BLAKE2b-256 checksum How to use checksums |
67640a02cfbb17e2f62348d718d3d8c827b3fee64dc45e3870345c1a1218537f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pyenzyme-2.3.0-py3-none-any.whl
| Download URL | pyenzyme-2.3.0-py3-none-any.whl |
|---|---|
| Size | 207.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f8e4969acc633af5e6aac5a2cf25d6217c45b60dd4919de880dd7b61b581779
|
|
BLAKE2b-256 checksum How to use checksums |
bf1536ba0b113e53cb0ff0a1135d54bfcf2c38516b4927225ce6741b93bb78de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for pyenzyme 2.3.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.