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

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.14.tar.gz (43.4 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.14-cp313-cp313-win_amd64.whl (257.8 kB view details)

Uploaded CPython 3.13Windows x86-64

rainbow_api-1.0.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (495.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.14-cp313-cp313-macosx_11_0_arm64.whl (118.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rainbow_api-1.0.14-cp312-cp312-win_amd64.whl (258.0 kB view details)

Uploaded CPython 3.12Windows x86-64

rainbow_api-1.0.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.14-cp312-cp312-macosx_11_0_arm64.whl (118.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rainbow_api-1.0.14-cp311-cp311-win_amd64.whl (258.0 kB view details)

Uploaded CPython 3.11Windows x86-64

rainbow_api-1.0.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (504.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.14-cp311-cp311-macosx_11_0_arm64.whl (118.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rainbow_api-1.0.14-cp310-cp310-win_amd64.whl (257.9 kB view details)

Uploaded CPython 3.10Windows x86-64

rainbow_api-1.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.14-cp310-cp310-macosx_11_0_arm64.whl (118.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rainbow_api-1.0.14-cp39-cp39-win_amd64.whl (258.2 kB view details)

Uploaded CPython 3.9Windows x86-64

rainbow_api-1.0.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (478.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.14-cp39-cp39-macosx_11_0_arm64.whl (119.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

rainbow_api-1.0.14-cp38-cp38-win_amd64.whl (259.0 kB view details)

Uploaded CPython 3.8Windows x86-64

rainbow_api-1.0.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (497.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.14-cp38-cp38-macosx_11_0_arm64.whl (120.8 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rainbow_api-1.0.14.tar.gz
  • Upload date:
  • Size: 43.4 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.14.tar.gz
Algorithm Hash digest
SHA256 e0c518bb1d1d95adecd0102de4eab4bc79b46b194b7e27883d55e7ee618595e7
MD5 4cbdbb16b3351464ace43e2d287bfdfb
BLAKE2b-256 a4bcb40db33c5b5e1bde4dfa42d92b884ec817ea4aaa421fce8c8b802d7ade6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14.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.14-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2d9950d21813878d889f95ea992d39ff264e08dd4fd482a1f5853f7d2a7e7907
MD5 9d492ee09fbc8b8817fadff793142afc
BLAKE2b-256 c977dbeff76094b88d95309acfeda1783f7c7eebfa58165985ca9431a3b98331

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45d68b561dbd86622bdd37716a68fb45eeed1a12a134a6e4fec7aff33fc4b499
MD5 73fc50aca25fc06703325c4e041b8292
BLAKE2b-256 6d51d92c4a0c4eb777d63fd1ca23ac076a110fac2b607cf980844be1b4235a1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28fdf83b9eb3c515d05eea7412436d61e2d13d69be2a7bb779475755e8e2133b
MD5 31ac78755259e7f043a5edf1c702752e
BLAKE2b-256 dd2b433c7c8ad6849fa9308c729d971574e221c1413e74cecf807e9d347862fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c09c4649b2e814903888bfc337b760c122e853845cb7b095a3aa35098518dc22
MD5 217ef33b7434330928756ef70ab678c4
BLAKE2b-256 f4d1a4f78400f175069edfd2a04ff76162b3b00b4df75a469d7d54b1aa675dd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48a96a35a82dcf884412d5ed1c526a3db406c9fccd5425f2f0033b7bd5885f34
MD5 767a8e2605c65e4dfe2859516a0388c6
BLAKE2b-256 93f789acd20d8513a8e67ef969aeb42b1355e990ab298facca90dda982f12f07

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12c53d3b2c67812b4e3d17ec50b94eb85b264e012a1f2797e2ddbbb2fc0b0f09
MD5 228c5d18b4b4d2b75b358a53e176ffbe
BLAKE2b-256 b96221601933a8c2895a4362871130f06a53f49cb19df466e2d29a667708e150

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1a7e9ee91778bec3a7f762917fe0a85762c6ab627c41cc8b1365f6962852e8ec
MD5 978e7cfd2d42bb09e6b4a73f186f2089
BLAKE2b-256 e07068b3f52d26344e4a4593df2a08356523bae4b7a29c294c469a8e75307797

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e74cb40fc38dbe02585922978ccb445c1d424b06da79cbe7df08d235057e88d4
MD5 0201fce1733100cecb66c0ebcbcdf69b
BLAKE2b-256 3842f7f88ff82f9c1327ec99a92947cddc822c0ab3edb8d04c5093acd210de6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e6c86bcfd2096a5b350e3b94362aa1de7b89ae15a0c8d23d6654949cc8e3c1e
MD5 1fca892a6926204ea90d8e8fe8954d07
BLAKE2b-256 6117a7e44af3b43bf1c38f5650c82bf54dc0fb162d5677cc3495c468ced903eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c0bf99a145a0c61445be898b37e3db615f2bed5d4e6c6d33851d4c96bd33e805
MD5 3ce254db89075772b83e70cb8b4c3871
BLAKE2b-256 be974f0a08a68f09ef976d82ff6c0d93de91a74bbf22a6a1fb4b5678740e2751

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd8ea05ffcdbbdcfd858af33259c67e6e730b3e67a28ee64e5ac3f118c679c6b
MD5 453024ea571c431e055f71f11bf31a05
BLAKE2b-256 0e6df77c9d3a1dda3b2b53e747af6fd0d29d93715a88c1143764c94b92ecdb8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28787b5e72c3614f7f1e307be9883dc137890588aeded92f3c54e27d0cdd0dc1
MD5 d96ba6c0b595c3bba5d3dd42ed9d008c
BLAKE2b-256 7ee861cf1b80af941925df424a2f94c26c1da3336e18d16698e63a4107c53fab

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: rainbow_api-1.0.14-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 258.2 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.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5c07a73e8356b1ac16a05be30ddb2874cc7bee2782112f59085352ed51826ea0
MD5 2f63d5dd1cd4070af8bd4afe3a7411ab
BLAKE2b-256 4d9d1743649145e1dab1d000a218bd43b072ab02f44f2e837645afae72bd5500

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65da0788c6921a025f1bddefd82e67500ae35a04e4999efcea8c0b266aa85211
MD5 cb785f2c41e8a69bba7ea0341f2b72a0
BLAKE2b-256 eca008447d738b46979c340d6487467dd18a1614eca5dffab7fb4e8787a91312

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 865d4bdacbb50b60286fc04533fcac2e4063bbbdf1a52376a5083b286e43363d
MD5 bfb07309085c2f2cac3bdbc06746f98e
BLAKE2b-256 72d3e47dc7ffab97a49a85bb4ebe7e4bdb132e8285d6b57df4bc275b0855ed40

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: rainbow_api-1.0.14-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 259.0 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.14-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 95be78ea569736731c8a62a6211a89298f9e3c66150e1390686adedd2e15970f
MD5 03eb296eb8ba8c679c953cdaef40dd40
BLAKE2b-256 394bb98ff419eb1d3174d51eca73a1ddf8518f50ae99465b5efe91809e9f9e54

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0da4a224791d082ae918839be4f7d0cb34dc13bbe389bfef8c8a6ac6306b43a3
MD5 f3d73f81ca567661bbec120603d0a404
BLAKE2b-256 9df8701f0bc2203136957ed21f5fce13eb9b286ada29b9c02404116f7a54095f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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.14-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rainbow_api-1.0.14-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e10001edcedcbe505aec523c75763fd04dc81cdd551785c9f503a428a0fb38c6
MD5 ac8ddbf9a7b0b5e52c9c2589a41bf3d0
BLAKE2b-256 2f89ca4ddfc9f9b8938c7097475e2eb0f8c48db82139cfc5d79d58bd66f2f0ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainbow_api-1.0.14-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