Welcome to the NistChemPy documentation!
NistChemPy provides unofficial Python tools for querying NIST Chemistry WebBook pages and extracting selected molecular-property records. It is not affiliated with, maintained by, or endorsed by NIST. Because the Chemistry WebBook does not provide a stable public web API for this package, functionality may depend on the current structure and behavior of the external web service.
Warning
NistChemPy no longer ships a prebuilt NIST Chemistry WebBook compound index.
Live WebBook search and individual compound-page parsing remain separate functionality, but local index search now requires a user-generated local index/cache.
Rebuilding a full section-availability index can require visiting one WebBook page per compound. With a polite 3 second delay and roughly 100,000-150,000 pages, the initial rebuild can take about 3.5-5+ days before retries and network overhead.
NistChemPy currently supports extraction of basic compound metadata, selected spectral records (IR, THz, MS, and UV-Vis), and gas chromatography records where these are available from the corresponding WebBook pages. Additional properties may be reachable through source URLs stored by the package, but direct extraction is intentionally limited to the implemented record types.
For serious scientific use, users should verify retrieved records against the original NIST Chemistry WebBook pages and the primary literature references given there. Package output should not be treated as an official NIST data product, a complete database dump, or a stable production API.
Main features
Search:
Search by name, chemical formula, CAS RN, InChI / InChI Key: nistchempy.run_search.
Search by structure, including substructural search: nistchempy.run_structural_search. RDKit is optional and is used for SMILES/InChI-to-MOL conversion helpers and local index structural search.
Search over a user-local compound index/cache with
nistchempy.WebBookIndex.from_cache()ornistchempy.get_local_index(). NistChemPy does not redistribute a prebuilt WebBook-derived index.
Compound info (nistchempy.compound.NistCompound):
Object stores parsed properties and corresponding source URLs.
Supports extraction of selected records:
2D and 3D atomic coordinates.
Spectral data (IR, MS, UV-Vis).
Gas chromatography data.
Supports JSON-like structured outputs via
to_dict(),to_record(), andto_records()helpers.
For more details see the CookBook section of this documentation.
Installation
NistChemPy can be installed as a PyPI package:
> pip install nistchempy
Requirements
Python 3.9+;
requests;
beautifulsoup4;
pandas;
platformdirs;
Data notice
NistChemPy does not redistribute a prebuilt NIST Chemistry WebBook index or generated WebBook-derived datasets.
Local indexes, caches, JSON exports, CSV files, and other artifacts generated by users are user-local data artifacts and are not covered by the NistChemPy software license.
See the repository’s DATA_NOTICE.md file for the full notice.
AI-assisted development
Starting with the 1.0.6 cleanup/update and continuing through the 2.0.0 development line, OpenAI coding agents were used to assist with implementation, refactoring, documentation, and tests. Other AI models were also used to discuss architecture and implementation details. See the AI-assisted development note for details.
Citation
Please cite the Zenodo Concept DOI for NistChemPy:
10.5281/zenodo.20235917
The Concept DOI is preferred for general citations because it represents the software across archived versions.
If you use NistChemPy in research, please cite the software using the metadata in the repository’s CITATION.cff file.
Useful links
NIST Chemistry WebBook: web application for accessing NIST Chemistry WebBook records.
GitHub: GitHub page of the package.
PyPI package: PyPI page of the package.
NistChemData: companion workflow repository with provenance-sensitive data-use caveats.