Skip to main content

Read chromatography and mass spectrometry binary files

Project description

rainbow

PyPI Documentation Status PyPI - Downloads

rainbow provides programmatic access to the raw data encoded in chromatography and mass spectrometry binary files. This library supports the following vendors and detectors:

Agilent .D

  • .uv - UV spectrum (supports incomplete files)
  • .ch - UV, FID, CAD, and ELSD channels
  • .ms - MS (supports incomplete files)
  • MSProfile.bin - HRMS

Agilent .dx (OpenLab CDS)

  • .UV - DAD spectrum
  • .CH - single-wavelength UV/DAD signals
  • .IT - instrument telemetry, as analog data (parse with telemetry=True)

Waters .raw

  • CHRO - CAD and ELSD, as well as miscellaneous analog data
  • FUNC - UV and MS

There is documentation for rainbow that also details the structure of each binary file format.

Installation

pip install rainbow-api

Prebuilt wheels include an optional compiled accelerator (see Performance); installation never requires a compiler, and rainbow works the same with or without it.

Usage

The easiest way to get started is to give rainbow a directory path. Assume that we have a directory mydata.D that contains a binary file DAD1.uv with UV data.

import rainbow as rb
datadir = rb.read("mydata.D")
datafile = datadir.get_file("DAD1A.uv")

Here, the datadir DataDirectory object contains a DataFile object for DAD1A.uv. The raw UV data is contained in numpy arrays that are attributes of datafile. Users may find the following particularly useful:

  • datafile.xlabels - 1D numpy array with retention times
  • datafile.ylabels - 1D numpy array with wavelengths
  • datafile.data - 2D numpy array with absorbances

There is a tutorial available. There are also example snippets for basic tasks. Or just check out the full API.

Performance

Decoding Agilent diode-array (DAD) .uv files is the one hot spot in the library: each file holds a large retention-time × wavelength grid of delta-encoded absorbances, and the decoding is inherently sequential, so it cannot be vectorized with NumPy. rainbow ships an optional compiled extension (rainbow/agilent/_uvdelta.pyx, built with Cython) that runs this inner loop in C, decoding large DAD files roughly 100× faster while producing bit-identical results.

The accelerator is entirely optional:

  • Prebuilt wheels on PyPI already include it, so pip install rainbow-api gives you the fast path with no compiler needed.
  • If you install from source without a compiler (or without Cython), the build simply skips the extension and rainbow falls back to a pure-Python decoder with identical output. You can check which path is active with rainbow.agilent.chemstation._uvdelta_fast is not None.

Other formats (.ch channels, .ms, MassHunter) are already fast and do not use the accelerator.

Contents

  • rainbow/ contains the code of the Python library.
  • docs/ contains code for generating documentation. To build documentation locally, you will need to install the sphinx and sphinx-rtd-theme packages. Then, move to the docs/ directory and run make html. The docpages will be generated under docs/_build.
  • tests/ contains unit tests for the library. These can be run with python -m unittest.

For development, an editable install (pip install -e .) compiles the optional accelerator in place if a C compiler and Cython are available; otherwise the pure-Python fallback is used. The parity between the two paths is checked by tests/test_accelerator.py.

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

rainbow_api-1.0.15.tar.gz (46.7 kB view details)

Uploaded Source

Built Distributions

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

rainbow_api-1.0.15-cp313-cp313-win_amd64.whl (261.4 kB view details)

Uploaded CPython 3.13Windows x86-64

rainbow_api-1.0.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.15-cp313-cp313-macosx_11_0_arm64.whl (121.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rainbow_api-1.0.15-cp312-cp312-win_amd64.whl (261.6 kB view details)

Uploaded CPython 3.12Windows x86-64

rainbow_api-1.0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (503.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.15-cp312-cp312-macosx_11_0_arm64.whl (122.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rainbow_api-1.0.15-cp311-cp311-win_amd64.whl (261.5 kB view details)

Uploaded CPython 3.11Windows x86-64

rainbow_api-1.0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.15-cp311-cp311-macosx_11_0_arm64.whl (121.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rainbow_api-1.0.15-cp310-cp310-win_amd64.whl (261.4 kB view details)

Uploaded CPython 3.10Windows x86-64

rainbow_api-1.0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (483.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.15-cp310-cp310-macosx_11_0_arm64.whl (122.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rainbow_api-1.0.15-cp39-cp39-win_amd64.whl (261.7 kB view details)

Uploaded CPython 3.9Windows x86-64

rainbow_api-1.0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (481.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.15-cp39-cp39-macosx_11_0_arm64.whl (122.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

rainbow_api-1.0.15-cp38-cp38-win_amd64.whl (262.6 kB view details)

Uploaded CPython 3.8Windows x86-64

rainbow_api-1.0.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (500.5 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.15-cp38-cp38-macosx_11_0_arm64.whl (124.3 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file rainbow_api-1.0.15.tar.gz.

File metadata

  • Download URL: rainbow_api-1.0.15.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rainbow_api-1.0.15.tar.gz
Algorithm Hash digest
SHA256 82fecca5ac1874a30ba924835afe1675cc33279025162fe6722b84e7c412e446
MD5 a7c17502f9a67ff6b4a9392d80dbec9d
BLAKE2b-256 d7bfdb16dc0df46da76eeaf429bfb3c089b96d5025c11053ef09e53ab08a5f53

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15.tar.gz:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 da54820de3b93bc64ee2b4f5323be20cc8f322c366a69b457cd9f6cdae628886
MD5 a6826714b0def110005f1e057b627e5b
BLAKE2b-256 bd8d0bf579b44072ece99e0e7d97c94f8bc83e324dcd70935593359d312bb413

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 66a54bc2176e252c1e3769f76d7d282875bfed83571082dc4f5581ee296a4d68
MD5 51bc3461ff99ef857148b1b54ad0c79c
BLAKE2b-256 ddc71f7dc6379be95ad92a64d403bcea003401f6d099880331384bd1521aebde

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df7fa48fa412b4d5d157eb8ce2419898c011e5d9c129f23695acef3a9355dd6d
MD5 191649e12a4299d9b4f47e3967b53899
BLAKE2b-256 b4f4938849a49bc251ea2119e02a0fd8d1a8eb68134c8edac730f72b62125df0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e56ff7ec6907af984145f19cf7a976deb84d310bf76621761838a5a11ced39f5
MD5 1dd2baca1a3681823758711b196a2220
BLAKE2b-256 dea652a7e12c8e84398b71dfa612ba5c2ccf90783f6f7684862d1e3b29f7e3cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e897b33a2360e3ebb80d2e7aae4fa9abb566f57cb7403d5671d6931ae551ee4
MD5 61f10b9fd2fbff335afa62a0ee267add
BLAKE2b-256 83b0224c96b0d270613ca14e5c43ceb85741ce9c9890066ab3b0121c24003fe9

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 64d580b80d3e8f114b6bd68ee6f90b4c181fe25545f066394ee1a56d4e2cd81d
MD5 40945e465b1d890683febafabf1dc8ee
BLAKE2b-256 7c63276bcb99a3385b3d8dc38a7d60a4908e741d724a6d9647cfbf5a7d248b5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4c2dad201c21ad4b1ac5c3dd46d36ac26a6e02fe22584df2a4131bee81367956
MD5 4ebfb18fbe3a4048a7b23aae3e5be9f7
BLAKE2b-256 52012d18288d7f6b30775140d7601e438a155f28d8155001bd2ef1459d980f2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 62e36ffe74c05b6f9b080b499463210df32f720c94a21873bf1a7a0dd170baf1
MD5 6e26f404d4b0f5e30af91bdacae5619e
BLAKE2b-256 8caa1ed83b227683b8659cde5de944c594ba8ed62794c238257fc7468c8b9524

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 13afd33f763cf8ee1bd2ab1aef1a26df2c2b85b8c2d947c82a024bcb5baefb07
MD5 0bf0dfeff9c4446ef45c7ac70119561f
BLAKE2b-256 b512c31fcb1883b34a13419876fa3d88aa3307f0f705366280690d9f25cbbe27

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 85745df3e7b1b7e8b144f1f2e6949ecc0cd42a577398008383c783d17d879024
MD5 bf17220a53501dcd23f058f28b4f56f9
BLAKE2b-256 a3117d275d1b36fa0c3d626cbf1ec351462130ab18c978c63a5c33dd7e5e7ab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49a8f802dee665188de79f39c2a02b27f0308a6cffeca4e85c6a8af4b62a6913
MD5 87e6576dcd2c46ba1a1d6b1fc87e42b8
BLAKE2b-256 f5b330e6457cb687ee7448413e941deac3f7c35a420b3e17bee13cdf8f73454c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 752ff7b7ede76dfe7b8deb415d0d4706766725f4d61bbb93a95daaa049b86659
MD5 10cdb094f2199ee47419569324b1e9d4
BLAKE2b-256 7cbddf7fa7131719cab89dce6f71fea1b70194dce432bd652afa06513bf33787

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: rainbow_api-1.0.15-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 261.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rainbow_api-1.0.15-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7febabfddd1f0ba9592d86e04af4abf011f883d538eade83ffd24dc37a82151f
MD5 54df0ef09cb5378678dd95cb59debfed
BLAKE2b-256 10e2d259791af72cce858b17503d709db25cd5c2ef4922de6677f42f4134ace3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 940346eb07749b0feb2240a843ad9f4efd10e38191ab049013ebaf7d818360dd
MD5 7c821fe3282201f5fc8fd531f0517b57
BLAKE2b-256 a3b55b3e57e671b6cf64f9900af51601f561025e40b8c983c357f1932850409f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3dfd62945e1b12ee1866cf0b5c13567e02640bb3a4e439a3c165672b47d02c31
MD5 e422c749e64575137b7f4afff947367b
BLAKE2b-256 958eb3f65c7189a432e5f7617c8144aa3e2bb1396fe0d3f43f845f07f0bf58cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: rainbow_api-1.0.15-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 262.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rainbow_api-1.0.15-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 562920735daf02013b2e77a6d64958296de6eaaecc242e3ce30b2aa97a70dade
MD5 c8eac7e3413959752414c298a97d86ce
BLAKE2b-256 21b240a5abcbd4372889c37f48b5564a6103ae9253088de63968b6a56c90556a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp38-cp38-win_amd64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be332be660ec05b1dcfbed30c5b18482bd2ed0fd6506f95aae5416e9b6c09fda
MD5 b7e7e0a5d5b31ad9f947915e52e03e5e
BLAKE2b-256 a0368846644ce1436baaa3cb29943a102314b02ab5edcf711a889922b8e11066

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainbow_api-1.0.15-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.15-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 209dfc3014cf49469059826748faf01caa88ed13115dad1a29cc78d87682b6ca
MD5 3ac7bc67253396cf168fbdcac8d40bf8
BLAKE2b-256 ad788cffe6f41a6b5c3125478afaae0c2540ccefcb42089ea9c5059d5c209d54

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.15-cp38-cp38-macosx_11_0_arm64.whl:

Publisher: publish.yml on evanyeyeye/rainbow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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