Nekmo / pip-rating

Check the health of your project's requirements and get a score for each dependency.
https://docs.nekmo.org/pip-rating/
MIT License
29 stars 1 forks source link

Implement libraries.io sourcerank api #48

Open Nekmo opened 1 year ago

Nekmo commented 1 year ago

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.py

The 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.py

Requirements

The pull request has the following requirements. Remember, if you have any questions, don't hesitate to ask!

If you have any questions or need any help, I'm here to help you! Good luck!

Checklist