This works well for some SMILES, for example for "Cc1noc(C)c1Br".
But for others, e.g. "Cn1c(=O)c2nc(Cl)[nH]c2n(C)c1=O", I get the following error:
Traceback (most recent call last):
File "/home/caro/leval/.snakemake/scripts/tmpqq4csqb1.find_pubchem_hits.py", line 37, in <module>
similars = pcp.get_compounds("Cn1c(=O)c2nc(Cl)[nH]c2n(C)c1=O", 'smiles', searchtype='similarity', threshold=similarity_threshold, as_dataframe=True)
File "/home/caro/leval/.snakemake/conda/db9d54b7c1d0500c41e4539e39469ab2/lib/python3.9/site-packages/pubchempy.py", line 321, in get_compounds
results = get_json(identifier, namespace, searchtype=searchtype, **kwargs)
File "/home/caro/leval/.snakemake/conda/db9d54b7c1d0500c41e4539e39469ab2/lib/python3.9/site-packages/pubchempy.py", line 299, in get_json
return json.loads(get(identifier, namespace, domain, operation, 'JSON', searchtype, **kwargs).decode())
File "/home/caro/leval/.snakemake/conda/db9d54b7c1d0500c41e4539e39469ab2/lib/python3.9/site-packages/pubchempy.py", line 288, in get
status = json.loads(response.decode())
File "/home/caro/leval/.snakemake/conda/db9d54b7c1d0500c41e4539e39469ab2/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/caro/leval/.snakemake/conda/db9d54b7c1d0500c41e4539e39469ab2/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/caro/leval/.snakemake/conda/db9d54b7c1d0500c41e4539e39469ab2/lib/python3.9/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 322816 column 7 (char 7196244)