pybliometrics-dev / pybliometrics

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

AuthorRetrieval get_key_remaining_quota() not working #349

Closed ezgikurt closed 2 days ago

ezgikurt commented 1 month ago

Hi, thanks for the great package! I am downloading some data on authors from scopus using AuthorRetrieval and I realised get_remaining_key_quota() always returns a none. It returns the correct number when I call the same field from ScopusSearch.

pybliometrics version: I tried this both in version 4.1 and 3.5.2, python version 3.8.17.

Code to reproduce the bug:

from pybliometrics.scopus import AuthorRetrieval
res= AuthorRetrieval(7103049994)
res.get_key_remaining_quota() == None
Michael-E-Rose commented 1 month ago

Please try res= AuthorRetrieval(7103049994, refresh=True) and check again.

The reason this works is that .get_key_remaining_quota() needs an actual download within the same session. If in your active session you didn't download anything, .get_key_remaining_quota() has nothing to report.