diff --git a/docs/source/guide/contribute.rst b/docs/source/guide/contribute.rst index 69a1446..7523692 100644 --- a/docs/source/guide/contribute.rst +++ b/docs/source/guide/contribute.rst @@ -18,6 +18,7 @@ Contributors - |ghi| `llazzaro `_ (Leonardo Lazzaro) - |ghi| `bjodah `_ (Björn Dahlgren) - |ghi| `RickardSjogren `_ (Rickard Sjögren) +- |ghi| `Hyeansung `_ (Kim, Hyeonsung) .. _`source code`: https://github.com/mcs07/PubChemPy .. _`Issue Tracker`: https://github.com/mcs07/PubChemPy/issues diff --git a/pubchempy.py b/pubchempy.py index 8de112f..c2656f3 100644 --- a/pubchempy.py +++ b/pubchempy.py @@ -1113,10 +1113,16 @@ def standardized_cid(self): May not exist if this Substance was not standardizable. """ + """ + Some substances of pubchem data doesnot provide compound key for c in self.record['compound']: if c['id']['type'] == CompoundIdType.STANDARDIZED: return c['id']['id']['cid'] - + """ + if 'compound' in self.record: + for c in self.record['compound']: + if c['id']['type'] == CompoundIdType.STANDARDIZED: + return c['id']['id']['cid'] @memoized_property def standardized_compound(self): """Return the :class:`~pubchempy.Compound` that was produced when this Substance was standardized.