A lightweight Python library for parsing mzML mass spectrometry files.
Project description
A lightweight Python library for parsing mzML mass spectrometry files. Implements a type-safe, lazy-loading API with direct support for modern mzML structures (>= 1.1.0).
Installation
pip install mzmlpy
Optional extras:
pip install mzmlpy[numpress] # MS-Numpress decoding
pip install mzmlpy[zstd] # Zstandard compression
Quick Start
from mzmlpy import Mzml
with Mzml("path/to/file.mzML") as reader:
print(f"File: {reader.file_name} | Spectra: {len(reader.spectra)}")
for spectrum in reader.spectra:
mz = spectrum.mz
intensity = spectrum.intensity
print(f" {spectrum.id} MS{spectrum.ms_level} — {len(mz)} peaks")
Both .mzML and .mzML.gz files are supported. Metadata is parsed eagerly; binary data is decoded on demand.
For full usage examples see the Getting Started guide and API Reference.
Development
just lint # ruff check
just format # ruff isort + format
just ty # ty type checker
just test # pytest
# or all at once:
just check
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mzmlpy-0.3.0.tar.gz.
File metadata
- Download URL: mzmlpy-0.3.0.tar.gz
- Upload date:
- Size: 110.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f27eefeae8c8a0fa1ed8dcc80330063f7525b060b17d0d7a8d0544b7446cf79a
|
|
| MD5 |
a30d562d7150f78390b2c5563b150ecd
|
|
| BLAKE2b-256 |
e3f80cabd1ddbca0670109c1338f117897bdb7ce5f8f05d51ed3f33b17aacd23
|
File details
Details for the file mzmlpy-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mzmlpy-0.3.0-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2a80078b37bf1defa8af83451542250a9bd9b75930572b532075755a7624b42
|
|
| MD5 |
1562e0cda10ee05a5bd410ec6767eece
|
|
| BLAKE2b-256 |
e9d41d8ba7157a4dfcde3ccddbcfe2db009681b4d9182ef06aff5d0d8bd39555
|