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

feat: auto generate missing endpoints #1529

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

pcriadoperez
Copy link
Collaborator

@pcriadoperez pcriadoperez commented Dec 25, 2024

This PR looks to create a script that scrapes the changelog of binance for all exisitng endpoints, and generates the code in python-binance for those missing endpoints.

  • Searches latest docs changelog for existing endpoints
  • Adds to Endpoints.md
  • Checks if endpoint already exists if not it adds function to client.py and async_client.py
  • Adds docs specifying an autogenerated function
  • Once functions are created they can be edited and changed and won't autogenerate again.

Known issues:

  • Assumes all endpoints are private.
  • I tried for each endpoint to find the website to autogenerate the docs using openAI and to see if it's a signed or not, however I removed the feature as for a lot of the endpoints that show in the changelog there is no spec or doc available.
  • Missing /futures prefix, I will add in a future PR as larger change is needed to admit prefix.

Alternative considered:

Instead of trying to search if the current function exists with a different name, it might be an interesting alternative to autogenerate all endpoints with default name for consistency.

Logs:

Found 4 deprecated endpoints in the docs.
Found 587 unique endpoints in the docs.
Filtered out 8 endpoints that don't match known prefixes
Remaining endpoints: 579
Added 431 endpoints to Endpoints.md
284 endpoints were added out of 579 scrapped in client.py
285 endpoints were added out of 579 scrapped in async_client.py

@pcriadoperez pcriadoperez marked this pull request as ready for review December 26, 2024 00:59
@pcriadoperez pcriadoperez self-assigned this Dec 26, 2024
@coveralls
Copy link

coveralls commented Dec 26, 2024

Coverage Status

coverage: 66.573% (-2.4%) from 68.96%
when pulling 47396b8 on pcriadoperez:generated-endpoints
into d8e2ce1 on sammchardy:master.

@carlosmiei
Copy link
Collaborator

Known issues:
Assumes all endpoints are private.

Hum this is problematic 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants