pybliometrics-dev / pybliometrics

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

Renaming .scopus to .pybliometrics doesn't work #230

Closed raffaem closed 2 years ago

raffaem commented 2 years ago

I have pybliometrics 3.1.0:

$ python3
Python 3.10.0 (default, Oct  4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pybliometrics
>>> print(pybliometrics.__version__)
3.1.0

In the documentation there is written that I can rename the ~/.scopus folder into a ~/.pybliometrics folder.

I have tried that but pybliometrics ask me for the API key again and re-creates the ~/.scopus folder:

Please enter your API Key(s), obtained from http://dev.elsevier.com/myapikey.html.  Separate multiple keys by comma:
XXXXXXXX
API Keys are sufficient for most users.  If you have an InstToken, please enter the token now;otherwise just press Enter:

Configuration file successfully created at /home/<myusername>/.scopus/config.ini
For details see https://pybliometrics.rtfd.io/en/stable/configuration.html.
Michael-E-Rose commented 2 years ago

Since you're on Linux, you don't face the issue of leading dots in foldernames that plagues Windows.

And you're sure the filename is exactly .pybliometrics (no double dots, no trailing blank, no typo)?

raffaem commented 2 years ago

Yes

$ mv .scopus .pybliometrics

The .scopus folder is re-created, and it asks for the API key:

Please enter your API Key(s), obtained from http://dev.elsevier.com/myapikey.html.  Separate multiple keys by comma:
raffaem commented 2 years ago

I have found it.

Renaming the folder is not sufficient.

You need to edit the config.ini to change the variables in the [Directories] header to use the new folder.

For example you need to change

AuthorSearch = /home/user/.scopus/author_search

to

AuthorSearch = /home/user/.pybliometrics/author_search
Michael-E-Rose commented 2 years ago

Ah yes. pybliometrics creates the folder mentioned in the configuration file if necessary, and if this happens to be the .scopus folder, it takes precedence over the .pybliometrics folder.

I will update the docs.