pymzml
high-throughput mzML parsing
What it is and what it does
pymzml is a Python parser for mzML, the standard mass spectrometry data format used in proteomics and metabolomics research. It provides fast, seekable access to spectra stored in mzML files—including support for compressed formats—and includes utilities for spectrum comparison and visualization. The core library depends only on numpy and regex, keeping installation simple, though optional extras add plotting and deconvolution capabilities.
The package is aimed at bioinformaticians and researchers who need to programmatically extract and analyze mass spectrometry data. It has been actively maintained since 2012 and currently requires Python 3.10 or higher. Installation is straightforward via pip, with optional feature flags for extended functionality like interactive plotting or pynumpress compression support.
Use it for:
- Extract and iterate over spectra from mzML files in a proteomics workflow.
- Build custom mass spectrometry data analysis pipelines that need rapid spectrum access.
- Compare spectra or perform spectral matching in metabolomics studies.
- Integrate mzML parsing into bioinformatics tools for automated MS data processing.
- Visualize mass spectrometry data interactively during exploratory analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pymzml parses mzML mass spectrometry data files in Python, providing fast random access to spectra and tools for spectrum comparison and visualization.
Yes. pymzml is actively maintained, has low install friction, carries no known vulnerabilities, and is the standard choice for mzML parsing in Python. Install it if you work with mass spectrometry data in proteomics or metabolomics; the core library is lightweight and optional features are available if needed.
Install
pymzml on PyPI
pip
pip install pymzmluv
uv add pymzmlpoetry
poetry add pymzmlInstalling pymzml
Before you install
Low friction install with only numpy and regex as core dependencies. Active maintenance with a recent release (52 days old) and ongoing repository activity. Requires Python 3.10 or higher.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute pymzml provided you include the license notice.
Quickstart
pip install pymzml
import pymzml
# Parse an mzML file and access spectra
run = pymzml.run.Reader('data.mzML')
for spectrum in run:
print(spectrum.ID, spectrum.mz, spectrum.i)
Requires Python 3.10 or higher; numpy must be installed before optional dependencies like pynumpress.
Verify before relying
- Whether the package's spectrum comparison and visualization functions work out-of-the-box or require optional dependencies.
- Performance characteristics for very large mzML files or highly compressed formats.
- Whether random access in compressed files requires specific file preparation or encoding.
Package facts
| License | The MIT license (permissive) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, regex |
| Maintenance | actively maintained — 52 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 166,281/month — #10,501 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymzml-2.6.1-py3-none-any.whl
Tags
More Bio-Informatics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
biopythonBiopython provides Python tools for…
unclear · top 5,000 on PyPI
firecrawl-pyClient library for the Firecrawl API that…
permissive · top 5,000 on PyPI
intervaltreeA self-balancing interval tree data structure…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
PubChemPyPubChemPy is a Python wrapper around the…
permissive · top 5,000 on PyPI
pyteomicsPyteomics provides Python tools for proteomics…
permissive · top 15,000 on PyPI
alchemlybalchemlyb parses molecular dynamics simulation…
permissive · top 15,000 on PyPI
libhreelsLibhreels reads, analyzes, and simulates…
unclear · top 15,000 on PyPI
mt2Computes stransverse mass (MT2) for particle…
permissive · top 15,000 on PyPI
specutilsSpecutils provides Python representations of…
permissive · top 15,000 on PyPI
dnaiodnaio reads and writes FASTQ, FASTA, and uBAM…
permissive · top 15,000 on PyPI
peppypeppy reads and manages Portable Encapsulated…
permissive · top 15,000 on PyPI
edam-ontologyProvides a Python-packaged version of the EDAM…
permissive · top 15,000 on PyPI