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.16.tar.gz (56.5 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.16-cp313-cp313-win_amd64.whl (476.9 kB view details)

Uploaded CPython 3.13Windows x86-64

rainbow_api-1.0.16-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (934.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.16-cp313-cp313-macosx_11_0_arm64.whl (199.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rainbow_api-1.0.16-cp312-cp312-win_amd64.whl (477.3 kB view details)

Uploaded CPython 3.12Windows x86-64

rainbow_api-1.0.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (942.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.16-cp312-cp312-macosx_11_0_arm64.whl (200.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rainbow_api-1.0.16-cp311-cp311-win_amd64.whl (476.6 kB view details)

Uploaded CPython 3.11Windows x86-64

rainbow_api-1.0.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (949.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.16-cp311-cp311-macosx_11_0_arm64.whl (199.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rainbow_api-1.0.16-cp310-cp310-win_amd64.whl (476.5 kB view details)

Uploaded CPython 3.10Windows x86-64

rainbow_api-1.0.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (899.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.16-cp310-cp310-macosx_11_0_arm64.whl (199.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rainbow_api-1.0.16-cp39-cp39-win_amd64.whl (477.0 kB view details)

Uploaded CPython 3.9Windows x86-64

rainbow_api-1.0.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (896.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.16-cp39-cp39-macosx_11_0_arm64.whl (200.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

rainbow_api-1.0.16-cp38-cp38-win_amd64.whl (478.6 kB view details)

Uploaded CPython 3.8Windows x86-64

rainbow_api-1.0.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (934.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

rainbow_api-1.0.16-cp38-cp38-macosx_11_0_arm64.whl (204.2 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: rainbow_api-1.0.16.tar.gz
  • Upload date:
  • Size: 56.5 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.16.tar.gz
Algorithm Hash digest
SHA256 3dc8d3a39dd5cb1903d2c22ae4c23a7e5122f7fcfb6c1637f872109a3c5c5d10
MD5 6e4acf6edc14cf3e8113dd335427be95
BLAKE2b-256 28f61510f5e92ffd92ddbf1c29baf7c902a200364d22cda13b0bf7a8bb61b308

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9634eaedcf17145f9e727c52fbc0db6990412f99464f986e7172d405055472fd
MD5 cdb463e640b94860b9c25d6477913578
BLAKE2b-256 bfab97bad33b5ef758c8f81fa68ce004fa1ea7d6249179d3e8d953240060deb7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09c3ab2b6f478321260b5ffa49b5229faaf1e69d74dc8040e27ea5fa3cf8f380
MD5 6a38cf11994c81b1f6f55fee9426f632
BLAKE2b-256 f94c33d293bc76cd1fd36198500fc6e36c3bd184e6688b8ac03caa9b4c6bf547

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b26672d9682c5c545daecc04d6f00030c153e98982310c97b845d8b35e37dcc
MD5 61e054b4a89299e7eb3c25c40e53c28b
BLAKE2b-256 5332647d5fc62d42af9df2b9b273b7a7e972ed184dc0c30ccb9c96e887b48b47

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 545a8cac56971396ad71445fe388b3500462a2d69f89f4f46170627e8cf0cbc7
MD5 39dacaa51732b4ef27ce0a01d571ae29
BLAKE2b-256 fcef7b31c6766fd4132072fccba41bcb1908a78b7ae7f8b05eb51cab9fbaadfc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 11013f9d4518b84c7ddeb5276ab5c62605b9ad81223fb8a4e1035c97320871ca
MD5 0c5295456abe936942167a4efe62c2c4
BLAKE2b-256 c60cafd436af3177d167195ade0cdd6605cc4f313daa122d831ba2dd0739d309

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4fd05022c3508f298817e68f44288e0de6f87510f6d5b7dcad420c30233d98ec
MD5 a5c95113108c3d92877ed7dfa997cf73
BLAKE2b-256 bf3e9e6fc659a435dd0e17ca1ae3fd4eb4988e6e856074513d6b1cb7d3535097

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e5d98e7acc1c1d3f4bdcf9107794ce7312dc4f14a08e7329eaa16a6c1c1857fe
MD5 18df61c21edf2bef0358a25b390f99ae
BLAKE2b-256 1c26529dffad6ba26384fa20ce7b6a14e034e869fb9ba7a32a79c7e584878a99

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 210ddd2bd36ffb336fb9ad63e1bfa3be82ee5574a25a6c5dc04439269fd5be38
MD5 749b476b0b8c23f73eea5cba33d5e767
BLAKE2b-256 1e3e5fc43ee74e58bea98ed5aad2252076342e1eabfb74b24ee6859b045a4928

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4288c361faebd11163b81b28c8f8524198148e4033e7b97723aeaeafbab11950
MD5 9ffd0b5fd94cdf3d4191c7dafc3d56f1
BLAKE2b-256 4f06af3c51a2b8a9be8a5421023463de843fcd2ac502f159f0875d223b3e487a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 45f9a64e112eab3567cca0fb224d3980b835dbe57369da1f8d1786a055998ced
MD5 5d73326694fe587ed57914dfa5eec3e1
BLAKE2b-256 030fe88dd71788fb47982651fa9d79e28097897d3fcb230501330bca702efaa7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c94df0e23d872af48fb31e48df9ef84da764c023966d1b9711c135551b6e64bf
MD5 322a407838082f56a5d0bfc6b84b7208
BLAKE2b-256 9628e582e72792b5b0a97ebc6c5401863ab55be77bb9c14485ddaa6113924199

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 880e2a6be1a1d73f1a7beb8859141d5ba893efb3ce1741173c4b3ece309692bc
MD5 770cc588af5654ce741afb5893407c7b
BLAKE2b-256 ee0e63d0bd3dd9cbf2bb7a39bb8d8d33ba4eac3c47eb5b5bd3fcbfcd97745a60

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rainbow_api-1.0.16-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 477.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.16-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4617438318f8e83088d611c4f187ab278500164bfc92fb216703e32e8168605f
MD5 881041433ee00122e476fa10afdc2960
BLAKE2b-256 6e7cbf58fc4ba1feed3822c9df65f3778a43c99363ee612a58d4ed397c53b807

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e87db67bb4d424bd77372eeadababf48007ab1d0dba634e98c2aea8fbe433c9
MD5 cfd768fc3ff97d68869b17774c5f54e0
BLAKE2b-256 725114eae54631789fc6de24bfeec8cd9e1671e45cc61be80a8e3c23a28d2ecb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9379f4eedcdc54dbe1386a0288f6be2cb9a27bb14f2be39ee9d2271bbf3b7901
MD5 c1ce91de39c85a921fc962a4aa317a36
BLAKE2b-256 cf3382cc5cb19b521be808cc0557c6202a826ecb3b0adf4f499c59d00fcbe6da

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rainbow_api-1.0.16-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 478.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.16-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d6559a5fba0e18d5c53f92016ee802d8fc8fb5fe112de95bd68827be27669073
MD5 52ddefbd76108e8b623437767b818a11
BLAKE2b-256 18982f4141365f4f65dcc8fd1ba26af4cc137d13981fda36aa41f2cf6e6a1964

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74dd6bddddb4d795c3bdba96d7b4d9e42092bac08e107728464bbc635cfef43d
MD5 a46a0ea34300265ebb5695eb4117cf79
BLAKE2b-256 4fd14d64fcf5e40cd21f75fc9ade83ee679340d30d352cf9dca8f2e713659328

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rainbow_api-1.0.16-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 744811745cf89fdf50c88395a07e486d437f71bb45eccb1b9dec12b6f351b3ae
MD5 7d9f2aaa8fcc79da6446a11528558336
BLAKE2b-256 034d7c8887763f30aa89448fd5a9ab09181fc326eeaea32d582153b94e2f7761

See more details on using hashes here.

Provenance

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