GithubHelp home page GithubHelp logo

dchud / substar Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.96 MB

supports data mining class project: fetch repo info+stats from github api, parse into an analyzable format

License: MIT License

Python 100.00%

substar's People

Contributors

dchud avatar

Watchers

 avatar  avatar

substar's Issues

repos/:owner/:name/contributors can be paged

it maxes out at 30 contributors if you don't paginate:

In [21]: r = requests.get('https://api.github.com/repos/mojombo/grit/contributors')

In [22]: r.links
Out[22]: 
{'last': {'rel': 'last',
  'url': 'https://api.github.com/repositories/1/contributors?page=2'},
 'next': {'rel': 'next',
  'url': 'https://api.github.com/repositories/1/contributors?page=2'}}

In [23]: r.links['next']['url']
Out[23]: 'https://api.github.com/repositories/1/contributors?page=2'

In [24]: r = requests.get(r.links['next']['url'])

In [25]: r.links
Out[25]: 
{'first': {'rel': 'first',
  'url': 'https://api.github.com/repositories/1/contributors?page=1'},
 'prev': {'rel': 'prev',
  'url': 'https://api.github.com/repositories/1/contributors?page=1'}}

maybe just stick with repos/:owner/:name/stats/contributors? does that paginate?

In [26]: r = requests.get('https://api.github.com/repos/mojombo/grit/stats/contributors')

In [27]: r.status_code
Out[27]: 200

In [28]: r.links
Out[28]: {}

In [29]: d = r.json()

In [30]: len(d)
Out[30]: 42

nope! there's your answer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.