Head First Into Github
We know nothing about Github OH MY!
import pandas, requests, requests_cache, operator, hvplot.pandas
requests_cache.install_cache('resident-demo')
s = pandas.Series({
project: F"https://api.github.com/repos/{project}"
for project in "ipython/ipython jupyter/notebook seatgeek/fuzzywuzzy".split()
})
g = s.apply(requests.get).apply(operator.methodcaller('json'))
g = g.apply(pandas.Series).set_index('id')
times = [x for x in g.columns if x.endswith('_at')]
g[times] = g[times].apply(pandas.to_datetime)
g = g.set_index(times, append=True)
g
node_id | name | full_name | private | owner | html_url | description | fork | url | forks_url | ... | disabled | open_issues_count | license | forks | open_issues | watchers | default_branch | organization | network_count | subscribers_count | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | created_at | updated_at | pushed_at | |||||||||||||||||||||
658518 | 2010-05-10 04:46:06+00:00 | 2019-10-30 14:51:26+00:00 | 2019-10-30 05:08:44+00:00 | MDEwOlJlcG9zaXRvcnk2NTg1MTg= | ipython | ipython/ipython | False | {'login': 'ipython', 'id': 230453, 'node_id': ... | https://github.com/ipython/ipython | Official repository for IPython itself. Other ... | False | https://api.github.com/repos/ipython/ipython | https://api.github.com/repos/ipython/ipython/f... | ... | False | 1238 | {'key': 'other', 'name': 'Other', 'spdx_id': '... | 3900 | 1238 | 13837 | master | {'login': 'ipython', 'id': 230453, 'node_id': ... | 3900 | 830 |
33653601 | 2015-04-09 06:58:03+00:00 | 2019-10-30 14:13:09+00:00 | 2019-10-29 22:48:39+00:00 | MDEwOlJlcG9zaXRvcnkzMzY1MzYwMQ== | notebook | jupyter/notebook | False | {'login': 'jupyter', 'id': 7388996, 'node_id':... | https://github.com/jupyter/notebook | Jupyter Interactive Notebook | False | https://api.github.com/repos/jupyter/notebook | https://api.github.com/repos/jupyter/notebook/... | ... | False | 1672 | {'key': 'other', 'name': 'Other', 'spdx_id': '... | 2687 | 1672 | 6422 | master | {'login': 'jupyter', 'id': 7388996, 'node_id':... | 2687 | 317 |
2019626 | 2011-07-08 19:32:34+00:00 | 2019-10-30 11:47:08+00:00 | 2019-09-17 15:35:29+00:00 | MDEwOlJlcG9zaXRvcnkyMDE5NjI2 | fuzzywuzzy | seatgeek/fuzzywuzzy | False | {'login': 'seatgeek', 'id': 447527, 'node_id':... | https://github.com/seatgeek/fuzzywuzzy | Fuzzy String Matching in Python | False | https://api.github.com/repos/seatgeek/fuzzywuzzy | https://api.github.com/repos/seatgeek/fuzzywuz... | ... | False | 62 | {'key': 'gpl-2.0', 'name': 'GNU General Public... | 668 | 62 | 6170 | master | {'login': 'seatgeek', 'id': 447527, 'node_id':... | 668 | 224 |
3 rows × 72 columns
g.license.apply(pandas.Series).join(g, rsuffix='_').hvplot.bar('full_name', 'open_issues', invert=True, grid=True)
g
node_id | name | full_name | private | owner | html_url | description | fork | url | forks_url | ... | disabled | open_issues_count | license | forks | open_issues | watchers | default_branch | organization | network_count | subscribers_count | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | created_at | updated_at | pushed_at | |||||||||||||||||||||
658518 | 2010-05-10 04:46:06+00:00 | 2019-10-30 14:51:26+00:00 | 2019-10-30 05:08:44+00:00 | MDEwOlJlcG9zaXRvcnk2NTg1MTg= | ipython | ipython/ipython | False | {'login': 'ipython', 'id': 230453, 'node_id': ... | https://github.com/ipython/ipython | Official repository for IPython itself. Other ... | False | https://api.github.com/repos/ipython/ipython | https://api.github.com/repos/ipython/ipython/f... | ... | False | 1238 | {'key': 'other', 'name': 'Other', 'spdx_id': '... | 3900 | 1238 | 13837 | master | {'login': 'ipython', 'id': 230453, 'node_id': ... | 3900 | 830 |
33653601 | 2015-04-09 06:58:03+00:00 | 2019-10-30 14:13:09+00:00 | 2019-10-29 22:48:39+00:00 | MDEwOlJlcG9zaXRvcnkzMzY1MzYwMQ== | notebook | jupyter/notebook | False | {'login': 'jupyter', 'id': 7388996, 'node_id':... | https://github.com/jupyter/notebook | Jupyter Interactive Notebook | False | https://api.github.com/repos/jupyter/notebook | https://api.github.com/repos/jupyter/notebook/... | ... | False | 1672 | {'key': 'other', 'name': 'Other', 'spdx_id': '... | 2687 | 1672 | 6422 | master | {'login': 'jupyter', 'id': 7388996, 'node_id':... | 2687 | 317 |
2019626 | 2011-07-08 19:32:34+00:00 | 2019-10-30 11:47:08+00:00 | 2019-09-17 15:35:29+00:00 | MDEwOlJlcG9zaXRvcnkyMDE5NjI2 | fuzzywuzzy | seatgeek/fuzzywuzzy | False | {'login': 'seatgeek', 'id': 447527, 'node_id':... | https://github.com/seatgeek/fuzzywuzzy | Fuzzy String Matching in Python | False | https://api.github.com/repos/seatgeek/fuzzywuzzy | https://api.github.com/repos/seatgeek/fuzzywuz... | ... | False | 62 | {'key': 'gpl-2.0', 'name': 'GNU General Public... | 668 | 62 | 6170 | master | {'login': 'seatgeek', 'id': 447527, 'node_id':... | 668 | 224 |
3 rows × 72 columns
g.unstack('id').stack('id')
node_id | name | full_name | private | owner | html_url | description | fork | url | forks_url | ... | disabled | open_issues_count | license | forks | open_issues | watchers | default_branch | organization | network_count | subscribers_count | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
created_at | updated_at | pushed_at | id | |||||||||||||||||||||
2010-05-10 04:46:06+00:00 | 2019-10-30 14:51:26+00:00 | 2019-10-30 05:08:44+00:00 | 658518 | MDEwOlJlcG9zaXRvcnk2NTg1MTg= | ipython | ipython/ipython | False | {'login': 'ipython', 'id': 230453, 'node_id': ... | https://github.com/ipython/ipython | Official repository for IPython itself. Other ... | False | https://api.github.com/repos/ipython/ipython | https://api.github.com/repos/ipython/ipython/f... | ... | False | 1238.0 | {'key': 'other', 'name': 'Other', 'spdx_id': '... | 3900.0 | 1238.0 | 13837.0 | master | {'login': 'ipython', 'id': 230453, 'node_id': ... | 3900.0 | 830.0 |
2011-07-08 19:32:34+00:00 | 2019-10-30 11:47:08+00:00 | 2019-09-17 15:35:29+00:00 | 2019626 | MDEwOlJlcG9zaXRvcnkyMDE5NjI2 | fuzzywuzzy | seatgeek/fuzzywuzzy | False | {'login': 'seatgeek', 'id': 447527, 'node_id':... | https://github.com/seatgeek/fuzzywuzzy | Fuzzy String Matching in Python | False | https://api.github.com/repos/seatgeek/fuzzywuzzy | https://api.github.com/repos/seatgeek/fuzzywuz... | ... | False | 62.0 | {'key': 'gpl-2.0', 'name': 'GNU General Public... | 668.0 | 62.0 | 6170.0 | master | {'login': 'seatgeek', 'id': 447527, 'node_id':... | 668.0 | 224.0 |
2015-04-09 06:58:03+00:00 | 2019-10-30 14:13:09+00:00 | 2019-10-29 22:48:39+00:00 | 33653601 | MDEwOlJlcG9zaXRvcnkzMzY1MzYwMQ== | notebook | jupyter/notebook | False | {'login': 'jupyter', 'id': 7388996, 'node_id':... | https://github.com/jupyter/notebook | Jupyter Interactive Notebook | False | https://api.github.com/repos/jupyter/notebook | https://api.github.com/repos/jupyter/notebook/... | ... | False | 1672.0 | {'key': 'other', 'name': 'Other', 'spdx_id': '... | 2687.0 | 1672.0 | 6422.0 | master | {'login': 'jupyter', 'id': 7388996, 'node_id':... | 2687.0 | 317.0 |
3 rows × 72 columns
pandas.Series(range(10)).apply(range).apply(list).apply(pandas.Series).stack().unstack()
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
---|---|---|---|---|---|---|---|---|---|
1 | 0.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2 | 0.0 | 1.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
3 | 0.0 | 1.0 | 2.0 | NaN | NaN | NaN | NaN | NaN | NaN |
4 | 0.0 | 1.0 | 2.0 | 3.0 | NaN | NaN | NaN | NaN | NaN |
5 | 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | NaN | NaN | NaN | NaN |
6 | 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 | NaN | NaN | NaN |
7 | 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 | 6.0 | NaN | NaN |
8 | 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 | 6.0 | 7.0 | NaN |
9 | 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 | 6.0 | 7.0 | 8.0 |
Written on October 29, 2019