Skip to main content

A lightweight Python library for parsing mzML mass spectrometry files.

Project description

MZMLpy Logo

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).

Python package codecov PyPI version Python 3.12+ License: MIT

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mzmlpy-0.3.0.tar.gz (110.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mzmlpy-0.3.0-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

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

Hashes for mzmlpy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f27eefeae8c8a0fa1ed8dcc80330063f7525b060b17d0d7a8d0544b7446cf79a
MD5 a30d562d7150f78390b2c5563b150ecd
BLAKE2b-256 e3f80cabd1ddbca0670109c1338f117897bdb7ce5f8f05d51ed3f33b17aacd23

See more details on using hashes here.

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

Hashes for mzmlpy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2a80078b37bf1defa8af83451542250a9bd9b75930572b532075755a7624b42
MD5 1562e0cda10ee05a5bd410ec6767eece
BLAKE2b-256 e9d41d8ba7157a4dfcde3ccddbcfe2db009681b4d9182ef06aff5d0d8bd39555

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page