Open kgChem opened 6 years ago
Having the same issue... Did you fix it?
same issue here
I think this is an error in the docs. The default identifier 'namespace' is CID, so if you want to query with SMILES you need to specify it with the second paramter:
>>> r = pcp.get_compounds('CC', 'smiles', searchtype='superstructure', listkey_count=3)
>>> print(r)
[Compound(6324), Compound(783), Compound(1038)]
Great, thanks for your work and your reply!
Hey @mcs07, really thanks for your work, I was looking for something which could give me the properties of the compounds using the SMILES notation. I tried using the get_properties
function using the namespace as 'smiles' but I got the same error of BadRequestError. Is there any unique for every user through which we need to call the API to this library or what? I can't really understand as to why this error pops up, the procedure is pretty simple!! Please let me know if you could help me this query...
Regards Divyansh
sometimes props = pcp.get_properties([]) gives the results without much ado.Many times it fails to respond.
@DivyanshAgrawal22 Have you solved this problem?
Running this code from the documentation:
pcp.get_compounds('CC', searchtype='superstructure', listkey_count=3)
Generates the following error:
This preceding example from the same page works without error: