Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Randomly sample Github repositories

I'm looking for a solution to randomly sample repos from Github. The final result is to perform some data analysis on the sample.

What I would like to do is sample by the repository's id: sample an int between 0 and 2.7 million and find the associated repo. After I have the username/repo-name, I'll use the api to get details.

The problem is I do not know how to search by repo id. Any suggestions? I'm open to webscraping or Python solutions.

like image 713
Cam.Davidson.Pilon Avatar asked Aug 16 '26 15:08

Cam.Davidson.Pilon


1 Answers

You can use python to access GitHUb V3 Api (as in "Most suitable python library for Github API v3").

And you can access GitHub repos, from a certain id (GET /repositories, with as parameter, integer ID of the last Repository that you’ve seen: so that can provide a roundabout way to access repos with their id.

like image 127
VonC Avatar answered Aug 18 '26 06:08

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!