GX Spectra Library: IR, UV/Vis and NMR reference spectra
GX Spectra Library is a small Debian desktop program I wrote to have IR, UV/Vis and NMR reference spectra at hand without repeating the web search every time. It searches them in the NIST Chemistry WebBook and nmrshiftdb2, previews them and keeps their original JCAMP-DX files in a local library that also works without a connection, from which CSV files and ZIP archives with their provenance can be exported. It is written in Python with Tkinter and Matplotlib and is independent of GX-TXT.
The presentation video
What it does
- Searches by compound name, preferably in English, or by CAS number: IR and UV/Vis spectra in the NIST Chemistry WebBook, 1H and 13C NMR in nmrshiftdb2. PubChem is only used to obtain the structure (SMILES) for the NMR search.
- Shows the preview with Matplotlib, with zoom, pan and image saving; the IR and NMR axes are reversed as is customary. NMR is drawn as arbitrary-height sticks, because the sources provide peak lists, not FIDs.
- Downloads up to 12 spectra per operation and keeps their unmodified original JCAMP-DX, recording source, URL, date, size and SHA-256 fingerprint in an SQLite catalogue. Predicted NMR records are hidden unless requested.
- A local library usable offline, with a filter on name, CAS, technique and description and a command to open the data folder.
- Exports two-column CSV files with comments on the source, copies the original JCAMP, creates multi-spectrum ZIP archives with a provenance
manifest.json; imports one’s own JCAMP, CSV or TXT files. - English and Italian interface through GNU gettext, chosen from the system language.
How to install it
From the Releases page download the package gx-spectra-library_0.1.1-2_all.deb and the SHA256SUMS file; from the folder that contains them:
sha256sum -c --ignore-missing SHA256SUMS
sudo apt install ./gx-spectra-library_0.1.1-2_all.deb
gx-spectra-library
APT installs the system dependencies and pip is not needed. The program also appears in the applications menu. To choose the language of a single run: LANGUAGE=en gx-spectra-library or LANGUAGE=it gx-spectra-library. From the source, use ./installa_ambiente.sh (virtual environment with the dependencies from pip) and ./avvia_spettri.sh instead.
Where it keeps the data
~/.local/share/gx-spectra-library/
├── catalogo.sqlite3
└── data/
├── IR/
├── UV_Vis/
├── NMR_1H/
└── NMR_13C/
The library lives outside the package: updating or removing the program does not delete the spectra. If XDG_DATA_HOME is set the folder is $XDG_DATA_HOME/gx-spectra-library, which allows separate libraries (for example for testing). At the first launch the package copies, without modifying it, any library of the old standalone version in ~/spettri.
What it needs to run
Debian 13 with the packages python3-tk, python3-numpy, python3-matplotlib, python3-requests, python3-bs4, xdg-utils and ca-certificates, which APT installs by itself. Nathan Hagen’s JCAMP-DX reader (MIT licence) is bundled. An internet connection is only needed for searching and downloading; the local library works offline.
Limits and data rights
- The NMR spectra of the sources are peak-position lists: the stick height is not an intensity and the record must be checked in the source database before using it for measurements.
- A database being accessible online does not make its data freely redistributable: the terms and citations of NIST (SRD 69, many IR spectra belong to the Coblentz Society) and of nmrshiftdb2 must be respected.
- The repository and the packages contain no spectra and no personal catalogues.
The code is distributed under the GNU GPL v3 or later; the bundled JCAMP reader keeps its MIT licence.
Where to find it
- Repository on GitHub: source, translations, packaging scripts, tests
- Release 0.1.1-2: Debian package, source archive and SHA-256 checksums
- Full README
- Complete guide with a benzene example: twelve real screenshots, deep dives and verification scripts