Local index usage

NistChemPy no longer ships a full WebBook-derived index. This notebook uses a tiny CSV fixture with the same column structure as a generated local index.

[1]:
from pathlib import Path

import nistchempy as nist

index_path = Path('example_index.csv')
if not index_path.exists():
    index_path = Path('docs/source/example_index.csv')

index = nist.get_local_index(index_path)
index.to_dataframe().loc[:, ['ID', 'name', 'formula', 'mol_weight']]
[1]:
ID name formula mol_weight
0 C7732185 Water H2O 18.0153
1 C71432 Benzene C6H6 78.1118
2 C64175 Ethanol C2H6O 46.0684
[2]:
index.search('benzene', fields='name').loc[:, ['ID', 'name', 'formula']]
[2]:
ID name formula
1 C71432 Benzene C6H6
[3]:
index.available_properties('C71432')
[3]:
{'mol2D': 'https://webbook.nist.gov/cgi/cbook.cgi?Str2File=C71432',
 'mol3D': 'https://webbook.nist.gov/cgi/cbook.cgi?Str3File=C71432',
 'Gas phase thermochemistry data': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=1#Thermo-Gas',
 'Condensed phase thermochemistry data': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=2#Thermo-Condensed',
 'Phase change data': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=4#Thermo-Phase',
 'Reaction thermochemistry data': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=8#Thermo-React',
 'Gas phase ion energetics data': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=20#Ion-Energetics',
 'Ion clustering data': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=40#Ion-Cluster',
 'IR Spectrum': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=80#IR-Spec',
 'Mass spectrum (electron ionization)': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=200#Mass-Spec',
 'UV/Visible spectrum': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=400#UV-Vis-Spec',
 'Gas Chromatography': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=2000#Gas-Chrom',
 'Vibrational and/or electronic energy levels': 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=800#Electronic-Spec',
 "Henry's Law data": 'https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=10#Solubility',
 'Fluid Properties': 'https://webbook.nist.gov/cgi/fluid.cgi?ID=C71432&Action=Page',
 'Electron-Impact Ionization Cross Sections (on physics web site)': 'https://physics.nist.gov/cgi-bin/Ionization/table.pl?ionization=C6H6xx0',
 'Gas Phase Kinetics Database': 'https://kinetics.nist.gov/kinetics/rpSearch?cas=71432',
 'NIST Polycyclic Aromatic Hydrocarbon Structure Index': 'https://pah.nist.gov/?q=pah001',
 'X-ray Photoelectron Spectroscopy Database, version 5.0': 'https://srdata.nist.gov/xps/SpectralByCompdDd/2349',
 'NIST / TRC Web Thermo Tables, "lite" edition (thermophysical and thermochemical data)': 'https://wtt-lite.nist.gov/wtt-lite/index.html?cmp=benzene',
 'NIST / TRC Web Thermo Tables, professional edition (thermophysical and thermochemical data)': 'https://wtt-pro.nist.gov/wtt-pro/index.html?cmp=benzene'}
[4]:
index.has_property('C71432', 'Mass spectrum (electron ionization)')
[4]:
True

The fixture is only a documentation example. Build a real local index with nistchempy index build --accept-data-terms when you need complete local discovery and section-availability filtering.