pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
407 stars 127 forks source link

Feature Request: Automatically update objects retrieved on older versions #269

Closed ceorellana closed 10 months ago

ceorellana commented 1 year ago

pybliometrics version: 3.4.0

Affected classes: AuthorRetrieval (so far)

I was thinking of reporting this as a bug but it's more of a request for "legacy support" per se. I was using AuthorRetrieval when I got an UnicodeDecodeError. Upon further inspection, I noticed that the object had already been downloaded on January 2021, which would correspond to at most version 2.7.2. Using the refresh parameter fixed the issue, but I don't think it would be viable to manually check for every object retrieved on prior versions to use the refresh parameter. I haven't checked if this is the case for the other classes, but I'm guessing it might be.

Would it be feasible to check on retrieval if an object was downloaded on a prior version to that retrieval function being updated, to then automatically apply the refresh parameter?

I would like to see if this is an isolated case or if this has happened to other users.

Michael-E-Rose commented 1 year ago

The refresh parameter accepts a number. It will be interpreted as maximum age in days. When you put refresh=500, the file gets automatically updated if it's older than 500 days, otherwise it stays as it is. I think this solves your issue.

As for what you proposed as solution, issue #125 is about the same idea: Let users know if the file has been downloaded already.