This script provides a command-line interface for searching ChemSpider for details of chemical structures.
search.py (1 KB)
The script uses the ChemSciPy wrapper for the ChemSpider API. If you don’t already have it, you can download the source code from GitHub. Don’t forget to add your ChemSpider security token, the wrapper won’t work otherwise.
Once you have the wrapper and configured it with your key, place the
search.py script in the same folder.
You can use the script in one of two ways. You can pass it a file containing search terms (one per line) like so:
§ python search.py <your-search-terms>.txt
Alternatively, you can run
python search.py without any arguments and enter your search terms from the command line. Press Crtl+D when you are done to start the search.