Skip to content

Instantly share code, notes, and snippets.

@tobigithub
tobigithub / xyz2om2.py
Created January 7, 2021 20:16 — forked from andersx/xyz2om2.py
XYZ to OM2
#!/usr/bin/env python2
import numpy as np
import sys
elements = dict()
elements["H"] = 1
elements["C"] = 6
elements["N"] = 7
elements["O"] = 8
elements["F"] = 9
@tobigithub
tobigithub / pubchem_convert_SMILES_to_IUPAC.py
Created October 15, 2021 18:08 — forked from mbohun/pubchem_convert_SMILES_to_IUPAC.py
pubchem_convert_SMILES_to_IUPAC.py use pubchem PUG REST to get IUPAC names/strings for SMILES
import sys
import requests
from lxml import etree
if __name__=="__main__":
smiles = sys.argv[1]
html_doc = requests.get("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/" + smiles + "/record/XML")
root = etree.XML(html_doc.text)