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.1.tar.gz (111.9 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.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file mzmlpy-0.3.1.tar.gz.

File metadata

  • Download URL: mzmlpy-0.3.1.tar.gz
  • Upload date:
  • Size: 111.9 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.1.tar.gz
Algorithm Hash digest
SHA256 3c25c4d7dbaa0ab165cec8dcad0e7b6d2353e0350408e310814653aad2688046
MD5 caac1fe884a794d099159921c2a5e205
BLAKE2b-256 d8753b6fefb84631ad310c181459ca12376a3eff08441a9de454849b9f3d5607

See more details on using hashes here.

File details

Details for the file mzmlpy-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: mzmlpy-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 38.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19a4c33a49f37ed6cf0e9178964ec47294a1e9e1cfa283e8cf5349b2fba57627
MD5 c0422360da4230e38be328d6dc4e0cc0
BLAKE2b-256 82f182ba738aea515d4fa3bc1b836df4746eeb9e870b60417faf36c49ccc2869

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