Currently, the project is using libraries.io through scraping, but after several attempts, the user may be banned. As an alternative, we can implement the libraries.io API (sourcerank section).
https://libraries.io/api/
For example:
https://libraries.io/api/pypi/<package_name>/sourcerank?api_key=<api_key>
The code is currently located in the sourcerank.py file. The new logic for using the API can be added to the same file. The new code should only be used if the api_key is provided as an environment variable. Otherwise, the existing logic should be used.
https://github.com/Nekmo/pip-rating/blob/master/pip_rating/sources/sourcerank.py
Describe your suggested feature
Resume
Currently, the project is using
libraries.io
through scraping, but after several attempts, the user may be banned. As an alternative, we can implement the libraries.io API (sourcerank
section). https://libraries.io/api/For example:
https://libraries.io/api/pypi/<package_name>/sourcerank?api_key=<api_key>
The code is currently located in the
sourcerank.py
file. The new logic for using the API can be added to the same file. The new code should only be used if the api_key is provided as an environment variable. Otherwise, the existing logic should be used. https://github.com/Nekmo/pip-rating/blob/master/pip_rating/sources/sourcerank.pyThe environment variable can be
LIBRARIESIO_TOKEN
, for example. An example using environment variables is available here: https://github.com/Nekmo/pip-rating/blob/master/pip_rating/sources/sourcecode_page.pyRequirements
The pull request has the following requirements. Remember, if you have any questions, don't hesitate to ask!
tests
anddocs
folders respectively.If you have any questions or need any help, I'm here to help you! Good luck!
Checklist