Title: Pagination support for lists by twidi · Pull Request #66 · ask/python-github2 · GitHub
Open Graph Title: Pagination support for lists by twidi · Pull Request #66 · ask/python-github2
X Title: Pagination support for lists by twidi · Pull Request #66 · ask/python-github2
Description: For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request. There is no easy way with the current code to know how much pages exist for a given list, so it's up to the user to manage the number of pages to retrieve. In my code i do something like this: # store all data from all pages result = [] # start with page one page = 1 # we don't know yet the max length of a page max_length = 0 while True: # get data for the current page page_result = github.repos.watching(username, page=page) # no result ? it's the end if not page_result: break # save the result result += page_result # check length of result l_page = len(page_result) # if smaller than max, it's the last page if l_page < max_length: break # if bigger, it's the new max if l_page > max_length: max_length = l_page # go next page page += 1 return result
Open Graph Description: For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request....
X Description: For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request....
Opengraph URL: https://github.com/ask/python-github2/pull/66
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:0ee54e3a-4313-1ccf-3ed5-b2fb8963dcdb |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 9268:DA633:1F45813:282EFCC:697472C2 |
| html-safe-nonce | b947eb1f9ed237822ead62397dd33a11d3c11c50b8f834d7fe3b313b5f3248c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjY4OkRBNjMzOjFGNDU4MTM6MjgyRUZDQzo2OTc0NzJDMiIsInZpc2l0b3JfaWQiOiI4NTY2NzU4MDMxMTE3MDIxODkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cc7a9ad2b45b56f7e3a88814009ec4e4309a3d71675a55e28be5920ba26cef57 |
| hovercard-subject-tag | pull_request:409465 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/ask/python-github2/pull/66/checks |
| twitter:image | https://avatars.githubusercontent.com/u/193474?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/193474?s=400&v=4 |
| og:image:alt | For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/ask/python-github2 git https://github.com/ask/python-github2.git |
| octolytics-dimension-user_id | 1558 |
| octolytics-dimension-user_login | ask |
| octolytics-dimension-repository_id | 179358 |
| octolytics-dimension-repository_nwo | ask/python-github2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 179358 |
| octolytics-dimension-repository_network_root_nwo | ask/python-github2 |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width