pybliometrics-dev / pybliometrics

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

Set API Key at runtime (through code) #294

Closed claell closed 10 months ago

claell commented 1 year ago

pybliometrics version: 3.5.2

Affected classes: ?

Expected behavior: I want the ability to set the required information for this package to run through code. That way, it can be ensured to for example easily run correctly on multiple machines.

Related: #161, #231

claell commented 1 year ago

A workaround that I now use is to specify the location of the config file to be inside the project folder. Thus, it can for example be versioned through git and synchronized across devices.

Michael-E-Rose commented 1 year ago

Maybe a bit hidden, but have you seen https://pybliometrics.readthedocs.io/en/stable/configuration.html#runtime?

claell commented 1 year ago

But that says "Setting the keys at runtime is however not possible."

I assume that means the API keys can't be set at runtime, right?

Michael-E-Rose commented 10 months ago

This will be fixed in #311 soon. This will constitute pybliometrics 3.0. We will experiment with a way to augment the new init() function with an option to pass on keys. Then the configuration is fixed per project but the keys are not.