# How to retrieve InChI key for KEGG compound?

I would like to retrieve the InChI representation for a given KEGG compound but I fail to find a direct solution for this (preferably doing it via bioservices).

One could do it via ChEBI like this:

from bioservices import *

kegg_con = KEGG()

kegg_entry = kegg_con.parse(kegg_con.get('C00047'))

chebi_con = ChEBI()

print chebi_entry.smiles
print chebi_entry.inchi
print chebi_entry.inchiKey


which will print

NCCCC[C@H](N)C(O)=O
InChI=1S/C6H14N2O2/c7-4-2-1-3-5(8)6(9)10/h5H,1-4,7-8H2,(H,9,10)/t5-/m0/s1
KDXKERNSBIXSRK-YFKPBYRVSA-N


Is there a direct way which does not require to go via ChEBI?

• I had a look at the KEGG rest API but couldn't find anything; I think you might need to access the data in the KEGG FTP (\$) Sep 1 '17 at 13:37
• @mgalardini: I checked that, but seems it is not available at all, or I overlooked it. The way above is still feasible, just requires one additional step.
– Cleb
Sep 1 '17 at 13:39
• It's not too bad, especially considering that you have a library to do it for you :) Sep 1 '17 at 15:43