krassowski / easy-entrez

Retrieve PubMed articles, text-mining annotations, or molecular data from >35 Entrez databases via easy to use Python package - built on top of Entrez E-utilities API.
https://easy-entrez.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
69 stars 6 forks source link

`fetch` method with JSON response raises exception #17

Closed GrazingScientist closed 1 year ago

GrazingScientist commented 1 year ago

Hi @krassowski ,

thanks for providing this cool package. :)

I just ran into an issue. When calling

result = eapi.fetch(['36999552', '36999549', '36999539'], max_results=3, return_type="xml")
batches.data

everything is fine. However, when changing to JSON response:

result = eapi.fetch(['36999552', '36999549', '36999539'], max_results=3, return_type="json")
batches.data

I get the exception: json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 9)

Can you reproduce that? Can you find out, why this happens?

Thanks a lot!

Cheers,

Adrian

GrazingScientist commented 1 year ago

Forget it! I just tried to reproduce it myself and failed to do so. :see_no_evil: