PubChemPy icon indicating copy to clipboard operation
PubChemPy copied to clipboard

Broken services or IP ban

Open StephaneKazmierczak opened this issue 8 years ago • 1 comments

Hi I am trying to get pubchem id for about 3k smiles, I worked one by one but was very slow, so I programmed a simple multi threading loop to get them a little faster, but it did work very well and now the service seems to be down I am getting PubChemHTTPError: 'Service Unavailable'

StephaneKazmierczak avatar Aug 09 '17 19:08 StephaneKazmierczak

Hi Stephane, do you mind sharing your loop code? I have minimal programming experience. I need to do something similar to yours, but I get an error (an internal server error). The following text loop doesn't work.

with open ("""directory/file.txt""") as f: ... for line in f: ... pcp.get_compounds(line, 'inchi', as_dataframe=True, searchtype='identity', identity_type='same_connectivity') ... time.sleep(0.5) ... if ' ' in line: ... break


But the following works fine:

with open("""directory/testfile.txt""") as f: ... for line in f: ... print (line) ... time.sleep(0.5) ... if ' ' in line: ... break

prints InChIs in the testfile.txt one at a time with 0.5 seconds delay after each line.


Thanks! -Moein

moeinj9 avatar Nov 13 '17 18:11 moeinj9