Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement libraries.io sourcerank api #48

Open
1 of 5 tasks
Nekmo opened this issue Oct 14, 2023 · 0 comments
Open
1 of 5 tasks

Implement libraries.io sourcerank api #48

Nekmo opened this issue Oct 14, 2023 · 0 comments
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@Nekmo
Copy link
Owner

Nekmo commented Oct 14, 2023

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!

  • The new code must coexist with the old code. If the token is not provided, the old logic must still work.
  • Check the existing code and the classes they inherit from. The information should be stored and returned with the same existing data structure.
  • Use Black to format your code. You can automate it using pre-commit.
  • Remember the tests and the documentation. They are located in the tests and docs folders respectively.

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

Checklist

  • I have searched for this issue before posting it and there isn't a duplicate.
@Nekmo Nekmo added enhancement New feature or request help wanted Extra attention is needed hacktoberfest labels Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant