Skip to content

Instantly share code, notes, and snippets.

@wsmts
wsmts / make-inxight-export.py
Created April 30, 2024 15:46 — forked from grishagin/make-inxight-export.py
A sample script showcasing key aspects of Inxight API.
import requests
from datetime import datetime
timestamp = datetime.today().strftime('%Y-%m-%d-%H%M%S')
export_file = f'export_{timestamp}.txt'
def get_additional_data(id):
r = requests.get(f'https://drugs.ncats.io/api/v1/substances({id})/@additional')
if 200 == r.status_code:
'''
Converts a list of SMILES to the corresponding Name, using Chemscript22 from ChemOffice
(Chemscript finally supports Python 3.10)
usage: python Smiles2Name.py input output
input -- text file containing a list of SMILES stings
output -- tabseparated list of the SMILES with the genarated name.
'''