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.13.tar.gz (43.3 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.13-cp313-cp313-win_amd64.whl (257.7 kB view details)

Uploaded CPython 3.13Windows x86-64

rainbow_api-1.0.13-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (495.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.13-cp313-cp313-macosx_11_0_arm64.whl (117.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rainbow_api-1.0.13-cp312-cp312-win_amd64.whl (257.9 kB view details)

Uploaded CPython 3.12Windows x86-64

rainbow_api-1.0.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.13-cp312-cp312-macosx_11_0_arm64.whl (118.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rainbow_api-1.0.13-cp311-cp311-win_amd64.whl (257.8 kB view details)

Uploaded CPython 3.11Windows x86-64

rainbow_api-1.0.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (504.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.13-cp311-cp311-macosx_11_0_arm64.whl (118.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rainbow_api-1.0.13-cp310-cp310-win_amd64.whl (257.7 kB view details)

Uploaded CPython 3.10Windows x86-64

rainbow_api-1.0.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.13-cp310-cp310-macosx_11_0_arm64.whl (118.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rainbow_api-1.0.13-cp39-cp39-win_amd64.whl (258.0 kB view details)

Uploaded CPython 3.9Windows x86-64

rainbow_api-1.0.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (478.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.13-cp39-cp39-macosx_11_0_arm64.whl (118.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

rainbow_api-1.0.13-cp38-cp38-win_amd64.whl (258.9 kB view details)

Uploaded CPython 3.8Windows x86-64

rainbow_api-1.0.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (496.9 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.13-cp38-cp38-macosx_11_0_arm64.whl (120.6 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rainbow_api-1.0.13.tar.gz
  • Upload date:
  • Size: 43.3 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.13.tar.gz
Algorithm Hash digest
SHA256 9842104cb823e8a23dbbcb0cefe0f3c0010be3d1a80b87b0512a3653adf296eb
MD5 e0271dc36a8b5a809b6a5dd4216bea94
BLAKE2b-256 8d8121f2a18a75d807ad3e1b537f7a9667444d85f2b8c66364edc185e4adedad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2963b0e29dac9295a0eb4bc4c9055a04de5a590bfad7255d38c64ffb71af5a30
MD5 6ce571b50817a8d0972ad29fcf4cbb7a
BLAKE2b-256 297f56eeab838da3dba1ec8800208753e33e897033d54c9b85758ec0861a45f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2beffd5ca66346bdf6ed8e4a573d85210a7e20cfdc89c7f548abb0349179b5b4
MD5 c32c142998e486aa806d1f9bfeef6edc
BLAKE2b-256 484c6594650b8a6f7973a160df21b1336b9d6fa5e4a041f7420775d820697c0a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7328e41df82c60186b61f7abb07e273c528c2209911f227730e2113c5eb75eea
MD5 08d066e2d3914c6270584ec3e96f693e
BLAKE2b-256 c713146f96afdab65c5dd15f3418e146f870f9cd2bb674d2a009b04e9e90e5f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 60ed5c7a4fef5d70e49a87ed0555e169fae156ba40977887b1f02b7c851d239c
MD5 1b11a6c8c8d52092831224d842129faa
BLAKE2b-256 301fa9d7372948772d7b96635eb4a70f92a06f0c6d7947cea9335add1096a606

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7fb684aec3fbb8e482728df090b2096d5fbc5703be026ba49189f5bd5f8b68ec
MD5 9f638a932963c659061616781e7bfcd9
BLAKE2b-256 338ac84e20b08b357e53af8d22610fe089ff899921a9d3a6dfb653a9923ad31f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ea88d19181c3e474a02e23d916fd0276f067e8b6ba0d016b9c8ce1dd95c776c9
MD5 284cb782a32af4e313ebf208b0cd3855
BLAKE2b-256 e0b9f8b0d9cba6babc9003bb38653201b2647e9f99aa018d789e3ce201eff2b3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 86c99ce64cd29981976aa4dcf5b2e4e51154e3a4dbe86a63db990774b94eeca0
MD5 b80ab81787de3a78b96e6655c4163b18
BLAKE2b-256 dcee1a470f90bd6adcf22e5393e732825fd1246c8e5284b7eec6254cdba502f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b0fe4db6a38567845114b8ec86145f9d020a3a750a38b633b88e5a1a58ca3bc
MD5 04849c96652591d28e7597188021a2f2
BLAKE2b-256 1d6d6b6b388e3e8412bbf2907a136a1d5020a88cb533896eca6a752df3c19fd2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80b33bed7228bcc2f25dc6c4afcb48c4da80fe5c17a36a42c4ac756fdbd57f27
MD5 f938b1ea0e57b8938d2cba4ff2419816
BLAKE2b-256 78d1b2424efc3b16209ea59f8ecaa191a8612c7c00b31d8aedf129954afc1ad5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 42c4c752da26226400f5cc99dd591e1585658767b35b9ff3d485a3170c65832a
MD5 4aad156a3d7604899472859b33046ab0
BLAKE2b-256 96f478f47112a1d4796d92a947399a06d403fd1ec62a75a8b79dfc294e550056

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16dcc03aa778559cb2f982f10128eba280892aa43fc58f1730144da53f294842
MD5 bf0aa5e4bd03fbfe72ec15716022366b
BLAKE2b-256 73009885b65da34b23a8c85a8e29f28d0c71e0c1e3b83f6a7bef3692214dca32

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 964bc48124175330dd4d322d4ade8c30165ad0c4aa8732d522152b470a5e6067
MD5 4b8da6ea2d8cf7fdd8a4cfaf85d7cf64
BLAKE2b-256 5a1c6e59cfd10a67bfbf3c12b1638f25ad0330703f7e45d09437c04e2ac4a764

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rainbow_api-1.0.13-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 258.0 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.13-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 079072c132f3ba634523f2fec01bcf43e4129b83b09699a8d798d92caaee34e9
MD5 c3d4f443a5f89559e8abea00791fb76f
BLAKE2b-256 3df762072e1707bbe8fe57e7951e165a04baadf7a75ebd4249e0b26faefce9fb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f6b6f821a70ece0aaeb91aa0829c64f71c2f9a89eb0ba595ef1920d9b353e13
MD5 844fad986e6cd16a41e0f08e477dd1f2
BLAKE2b-256 ef48ba5e18ed4b8493c6dd78589c3d1dfc8275d2ca0f7bcfa97df52fb9eff717

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7ecde28ddb59a23a85915e82024e2434090d57eb60187fd0327b4c4294849451
MD5 62397c15a064b4c383cfdebc008f352f
BLAKE2b-256 ab04e939943ec70097edc6051c49ab30fcb9b35f1003fcc7e05e7999ba7b92d6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rainbow_api-1.0.13-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 258.9 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.13-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bc4320abaf9d827c4c7d7651b31d94f07a00404ea24b40b9a4ddd3456e38adb9
MD5 81ab735045221da84f2f3add527cb4ef
BLAKE2b-256 b9abaa882c14c98ed5e6def914891238c2cabcfbe16add9a7b957df0994815f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47ef79cbb364a25f2e62a51be25872f933304a29d1590c54f5393a04cf76c054
MD5 044d6701eece18988977d0e7ac8fa934
BLAKE2b-256 4a326d94a65448ccd3c9998653fbb56d89472f232c0b7d59179d2b9542823dc5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.13-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d5b669b5a7e61ebf01eec8e54a043ec026547ab73e59ab5f3eca994ef84b79c
MD5 5c7f81e5fc81f0fb837974462660f4b8
BLAKE2b-256 c185ad1da353191cf7ab49b72935585095ca1e847b73e9edc854487487b15087

See more details on using hashes here.

Provenance

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