|
1 | 1 | {
|
2 |
| - "metadata": { |
3 |
| - "name": "", |
4 |
| - "signature": "sha256:2d234b400db23a8a564289d081cd262369729acb74813177cd991585e0f66fe9" |
5 |
| - }, |
6 |
| - "nbformat": 3, |
7 |
| - "nbformat_minor": 0, |
8 |
| - "worksheets": [ |
| 2 | + "cells": [ |
9 | 3 | {
|
10 |
| - "cells": [ |
11 |
| - { |
12 |
| - "cell_type": "heading", |
13 |
| - "level": 1, |
14 |
| - "metadata": {}, |
15 |
| - "source": [ |
16 |
| - "Listing repositories by their owner" |
17 |
| - ] |
18 |
| - }, |
19 |
| - { |
20 |
| - "cell_type": "code", |
21 |
| - "collapsed": false, |
22 |
| - "input": [ |
23 |
| - "import github3" |
24 |
| - ], |
25 |
| - "language": "python", |
26 |
| - "metadata": {}, |
27 |
| - "outputs": [], |
28 |
| - "prompt_number": 1 |
29 |
| - }, |
30 |
| - { |
31 |
| - "cell_type": "code", |
32 |
| - "collapsed": false, |
33 |
| - "input": [ |
34 |
| - "for repository in github3.repositories_by('sigmavirus24'):\n", |
35 |
| - " print('{0} created at {0.created_at}'.format(repository))" |
36 |
| - ], |
37 |
| - "language": "python", |
38 |
| - "metadata": {}, |
39 |
| - "outputs": [ |
40 |
| - { |
41 |
| - "output_type": "stream", |
42 |
| - "stream": "stdout", |
43 |
| - "text": [ |
44 |
| - "sigmavirus24/betamax created at 2013-07-16 03:23:22+00:00\n", |
45 |
| - "sigmavirus24/betamax_matchers created at 2014-07-19 18:51:39+00:00\n", |
46 |
| - "sigmavirus24/catapultpgh created at 2013-02-11 17:16:43+00:00\n", |
47 |
| - "sigmavirus24/charade created at 2012-11-28 03:24:20+00:00\n", |
48 |
| - "sigmavirus24/clint created at 2013-02-10 21:09:02+00:00\n", |
49 |
| - "sigmavirus24/contrib-hub created at 2013-11-30 18:36:55+00:00\n", |
50 |
| - "sigmavirus24/crequests created at 2013-01-24 22:54:17+00:00\n", |
51 |
| - "sigmavirus24/curryer created at 2013-11-10 02:03:42+00:00\n", |
52 |
| - "sigmavirus24/c_libs created at 2012-06-11 14:45:35+00:00\n", |
53 |
| - "sigmavirus24/ddg created at 2012-12-16 22:11:35+00:00\n", |
54 |
| - "sigmavirus24/developer.github.com created at 2012-05-27 04:19:17+00:00\n", |
55 |
| - "sigmavirus24/dream-python created at 2014-08-13 15:55:44+00:00\n", |
56 |
| - "sigmavirus24/elephant created at 2013-03-27 18:25:03+00:00\n", |
57 |
| - "sigmavirus24/euler.hs created at 2013-10-19 01:19:03+00:00\n", |
58 |
| - "sigmavirus24/expecter created at 2012-07-25 03:02:58+00:00\n", |
59 |
| - "sigmavirus24/format-geojson.clj created at 2013-10-25 22:17:20+00:00\n", |
60 |
| - "sigmavirus24/ghsync created at 2012-10-17 13:49:42+00:00\n", |
61 |
| - "sigmavirus24/git-hub created at 2012-10-05 19:35:45+00:00\n", |
62 |
| - "sigmavirus24/GITenberg created at 2012-09-25 21:07:30+00:00\n", |
63 |
| - "sigmavirus24/github-cli created at 2012-07-05 14:58:47+00:00\n", |
64 |
| - "sigmavirus24/github3.py created at 2012-03-13 19:58:53+00:00\n", |
65 |
| - "sigmavirus24/GitPython created at 2012-11-28 16:27:22+00:00\n", |
66 |
| - "sigmavirus24/grequests created at 2012-12-30 23:04:12+00:00\n", |
67 |
| - "sigmavirus24/gtk-vikb created at 2012-07-16 23:18:15+00:00\n", |
68 |
| - "sigmavirus24/heroku-buildpack-python created at 2013-01-19 18:09:35+00:00\n", |
69 |
| - "sigmavirus24/http11 created at 2014-07-21 01:57:47+00:00\n", |
70 |
| - "sigmavirus24/httpbin created at 2013-07-19 18:53:30+00:00\n", |
71 |
| - "sigmavirus24/hyper created at 2014-02-20 16:02:48+00:00\n", |
72 |
| - "sigmavirus24/issues.py created at 2012-02-25 21:32:31+00:00\n", |
73 |
| - "sigmavirus24/LendingClubAutoInvestor created at 2013-05-08 14:56:33+00:00\n", |
74 |
| - "sigmavirus24/libyaml created at 2013-12-01 18:27:17+00:00\n", |
75 |
| - "sigmavirus24/lyahfgg created at 2013-07-31 02:47:36+00:00\n", |
76 |
| - "sigmavirus24/madison_geojson created at 2013-10-25 20:40:41+00:00\n", |
77 |
| - "sigmavirus24/mccabe created at 2014-04-18 18:30:26+00:00\n", |
78 |
| - "sigmavirus24/mixfaster created at 2012-06-30 00:13:21+00:00\n", |
79 |
| - "sigmavirus24/mixminion created at 2011-09-06 13:34:15+00:00\n", |
80 |
| - "sigmavirus24/mock_github_api created at 2012-12-21 23:14:08+00:00\n", |
81 |
| - "sigmavirus24/nothub created at 2013-01-29 18:00:15+00:00\n", |
82 |
| - "sigmavirus24/No_Agenda_Bat_Sig created at 2010-11-05 03:18:10+00:00\n", |
83 |
| - "sigmavirus24/octokit.rb created at 2013-12-12 02:32:30+00:00\n", |
84 |
| - "sigmavirus24/ordinary created at 2013-06-15 18:09:48+00:00\n", |
85 |
| - "sigmavirus24/patch-converter created at 2012-11-26 13:52:57+00:00\n", |
86 |
| - "sigmavirus24/pelican created at 2012-06-14 14:25:45+00:00\n", |
87 |
| - "sigmavirus24/pelican-themes created at 2012-06-14 13:51:35+00:00\n", |
88 |
| - "sigmavirus24/pep8 created at 2012-09-06 14:13:14+00:00\n", |
89 |
| - "sigmavirus24/pip created at 2014-01-07 14:27:24+00:00\n", |
90 |
| - "sigmavirus24/polynomials.py created at 2013-04-10 03:12:06+00:00\n", |
91 |
| - "sigmavirus24/PyF-ck created at 2013-05-01 22:14:11+00:00\n", |
92 |
| - "sigmavirus24/pyflakes created at 2014-07-23 15:06:17+00:00\n", |
93 |
| - "sigmavirus24/pyflakes-old created at 2013-01-28 00:25:27+00:00\n", |
94 |
| - "sigmavirus24/python-guide created at 2012-06-15 18:00:03+00:00\n", |
95 |
| - "sigmavirus24/python-interview-questions created at 2014-08-13 02:32:38+00:00\n", |
96 |
| - "sigmavirus24/pyyaml created at 2013-12-01 18:29:02+00:00\n", |
97 |
| - "sigmavirus24/rack created at 2014-07-13 00:51:30+00:00\n", |
98 |
| - "sigmavirus24/recipes created at 2013-01-25 04:31:44+00:00\n", |
99 |
| - "sigmavirus24/repl_fun created at 2013-03-30 15:13:42+00:00\n", |
100 |
| - "sigmavirus24/requests created at 2012-06-15 13:47:06+00:00\n", |
101 |
| - "sigmavirus24/requests-data-schemes created at 2013-01-07 04:49:50+00:00\n", |
102 |
| - "sigmavirus24/requests-ntlm created at 2014-07-18 21:32:31+00:00\n", |
103 |
| - "sigmavirus24/requests-toolbelt created at 2013-12-29 21:19:08+00:00\n", |
104 |
| - "sigmavirus24/requests.rb created at 2013-02-01 02:52:28+00:00\n", |
105 |
| - "sigmavirus24/rfc3986 created at 2014-06-25 14:25:11+00:00\n", |
106 |
| - "sigmavirus24/shipit created at 2013-05-22 19:32:18+00:00\n", |
107 |
| - "sigmavirus24/solarized-pygment created at 2013-01-13 23:36:54+00:00\n", |
108 |
| - "sigmavirus24/sprunge.py created at 2012-06-09 14:19:26+00:00\n", |
109 |
| - "sigmavirus24/subscribed created at 2012-10-07 03:40:31+00:00\n", |
110 |
| - "sigmavirus24/Todo.txt-python created at 2012-09-16 19:31:58+00:00\n", |
111 |
| - "sigmavirus24/update_firefox created at 2012-06-19 01:56:02+00:00\n", |
112 |
| - "sigmavirus24/uritemplate created at 2013-05-14 16:52:08+00:00\n", |
113 |
| - "sigmavirus24/urllib3 created at 2013-12-04 03:04:13+00:00\n", |
114 |
| - "sigmavirus24/vcr created at 2013-09-18 03:15:42+00:00\n", |
115 |
| - "sigmavirus24/vim-stopsign created at 2013-09-03 13:26:03+00:00\n", |
116 |
| - "sigmavirus24/www.gittip.com created at 2013-01-16 13:15:38+00:00\n", |
117 |
| - "sigmavirus24/x11-ssh-askpass created at 2011-09-08 15:25:05+00:00\n", |
118 |
| - "sigmavirus24/zero created at 2013-09-15 02:17:30+00:00\n", |
119 |
| - "sigmavirus24/zero_buffer created at 2014-07-31 18:46:36+00:00\n" |
120 |
| - ] |
121 |
| - } |
122 |
| - ], |
123 |
| - "prompt_number": 2 |
124 |
| - }, |
125 |
| - { |
126 |
| - "cell_type": "markdown", |
127 |
| - "metadata": {}, |
128 |
| - "source": [ |
129 |
| - "You can also login and fork each of these repositories." |
130 |
| - ] |
131 |
| - }, |
132 |
| - { |
133 |
| - "cell_type": "code", |
134 |
| - "collapsed": false, |
135 |
| - "input": [ |
136 |
| - "gh = github3.login('username', 'password')" |
137 |
| - ], |
138 |
| - "language": "python", |
139 |
| - "metadata": {}, |
140 |
| - "outputs": [], |
141 |
| - "prompt_number": 3 |
142 |
| - }, |
143 |
| - { |
144 |
| - "cell_type": "code", |
145 |
| - "collapsed": false, |
146 |
| - "input": [ |
147 |
| - "for repository in gh.repositories_by('sigmavirus24'):\n", |
148 |
| - " repository.create_fork()" |
149 |
| - ], |
150 |
| - "language": "python", |
151 |
| - "metadata": {}, |
152 |
| - "outputs": [] |
153 |
| - }, |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "# Listing repositories by their owner" |
| 8 | + ] |
| 9 | + }, |
| 10 | + { |
| 11 | + "cell_type": "code", |
| 12 | + "execution_count": 1, |
| 13 | + "metadata": {}, |
| 14 | + "outputs": [], |
| 15 | + "source": [ |
| 16 | + "import github3" |
| 17 | + ] |
| 18 | + }, |
| 19 | + { |
| 20 | + "cell_type": "code", |
| 21 | + "execution_count": 2, |
| 22 | + "metadata": {}, |
| 23 | + "outputs": [ |
154 | 24 | {
|
155 |
| - "cell_type": "markdown", |
156 |
| - "metadata": {}, |
157 |
| - "source": [ |
158 |
| - "If you wanted to fork an organization to you, you could do the following: " |
| 25 | + "name": "stdout", |
| 26 | + "output_type": "stream", |
| 27 | + "text": [ |
| 28 | + "sigmavirus24/betamax created at 2013-07-16 03:23:22+00:00\n", |
| 29 | + "sigmavirus24/betamax_matchers created at 2014-07-19 18:51:39+00:00\n", |
| 30 | + "sigmavirus24/catapultpgh created at 2013-02-11 17:16:43+00:00\n", |
| 31 | + "sigmavirus24/charade created at 2012-11-28 03:24:20+00:00\n", |
| 32 | + "sigmavirus24/clint created at 2013-02-10 21:09:02+00:00\n", |
| 33 | + "sigmavirus24/contrib-hub created at 2013-11-30 18:36:55+00:00\n", |
| 34 | + "sigmavirus24/crequests created at 2013-01-24 22:54:17+00:00\n", |
| 35 | + "sigmavirus24/curryer created at 2013-11-10 02:03:42+00:00\n", |
| 36 | + "sigmavirus24/c_libs created at 2012-06-11 14:45:35+00:00\n", |
| 37 | + "sigmavirus24/ddg created at 2012-12-16 22:11:35+00:00\n", |
| 38 | + "sigmavirus24/developer.github.com created at 2012-05-27 04:19:17+00:00\n", |
| 39 | + "sigmavirus24/dream-python created at 2014-08-13 15:55:44+00:00\n", |
| 40 | + "sigmavirus24/elephant created at 2013-03-27 18:25:03+00:00\n", |
| 41 | + "sigmavirus24/euler.hs created at 2013-10-19 01:19:03+00:00\n", |
| 42 | + "sigmavirus24/expecter created at 2012-07-25 03:02:58+00:00\n", |
| 43 | + "sigmavirus24/format-geojson.clj created at 2013-10-25 22:17:20+00:00\n", |
| 44 | + "sigmavirus24/ghsync created at 2012-10-17 13:49:42+00:00\n", |
| 45 | + "sigmavirus24/git-hub created at 2012-10-05 19:35:45+00:00\n", |
| 46 | + "sigmavirus24/GITenberg created at 2012-09-25 21:07:30+00:00\n", |
| 47 | + "sigmavirus24/github-cli created at 2012-07-05 14:58:47+00:00\n", |
| 48 | + "sigmavirus24/github3.py created at 2012-03-13 19:58:53+00:00\n", |
| 49 | + "sigmavirus24/GitPython created at 2012-11-28 16:27:22+00:00\n", |
| 50 | + "sigmavirus24/grequests created at 2012-12-30 23:04:12+00:00\n", |
| 51 | + "sigmavirus24/gtk-vikb created at 2012-07-16 23:18:15+00:00\n", |
| 52 | + "sigmavirus24/heroku-buildpack-python created at 2013-01-19 18:09:35+00:00\n", |
| 53 | + "sigmavirus24/http11 created at 2014-07-21 01:57:47+00:00\n", |
| 54 | + "sigmavirus24/httpbin created at 2013-07-19 18:53:30+00:00\n", |
| 55 | + "sigmavirus24/hyper created at 2014-02-20 16:02:48+00:00\n", |
| 56 | + "sigmavirus24/issues.py created at 2012-02-25 21:32:31+00:00\n", |
| 57 | + "sigmavirus24/LendingClubAutoInvestor created at 2013-05-08 14:56:33+00:00\n", |
| 58 | + "sigmavirus24/libyaml created at 2013-12-01 18:27:17+00:00\n", |
| 59 | + "sigmavirus24/lyahfgg created at 2013-07-31 02:47:36+00:00\n", |
| 60 | + "sigmavirus24/madison_geojson created at 2013-10-25 20:40:41+00:00\n", |
| 61 | + "sigmavirus24/mccabe created at 2014-04-18 18:30:26+00:00\n", |
| 62 | + "sigmavirus24/mixfaster created at 2012-06-30 00:13:21+00:00\n", |
| 63 | + "sigmavirus24/mixminion created at 2011-09-06 13:34:15+00:00\n", |
| 64 | + "sigmavirus24/mock_github_api created at 2012-12-21 23:14:08+00:00\n", |
| 65 | + "sigmavirus24/nothub created at 2013-01-29 18:00:15+00:00\n", |
| 66 | + "sigmavirus24/No_Agenda_Bat_Sig created at 2010-11-05 03:18:10+00:00\n", |
| 67 | + "sigmavirus24/octokit.rb created at 2013-12-12 02:32:30+00:00\n", |
| 68 | + "sigmavirus24/ordinary created at 2013-06-15 18:09:48+00:00\n", |
| 69 | + "sigmavirus24/patch-converter created at 2012-11-26 13:52:57+00:00\n", |
| 70 | + "sigmavirus24/pelican created at 2012-06-14 14:25:45+00:00\n", |
| 71 | + "sigmavirus24/pelican-themes created at 2012-06-14 13:51:35+00:00\n", |
| 72 | + "sigmavirus24/pep8 created at 2012-09-06 14:13:14+00:00\n", |
| 73 | + "sigmavirus24/pip created at 2014-01-07 14:27:24+00:00\n", |
| 74 | + "sigmavirus24/polynomials.py created at 2013-04-10 03:12:06+00:00\n", |
| 75 | + "sigmavirus24/PyF-ck created at 2013-05-01 22:14:11+00:00\n", |
| 76 | + "sigmavirus24/pyflakes created at 2014-07-23 15:06:17+00:00\n", |
| 77 | + "sigmavirus24/pyflakes-old created at 2013-01-28 00:25:27+00:00\n", |
| 78 | + "sigmavirus24/python-guide created at 2012-06-15 18:00:03+00:00\n", |
| 79 | + "sigmavirus24/python-interview-questions created at 2014-08-13 02:32:38+00:00\n", |
| 80 | + "sigmavirus24/pyyaml created at 2013-12-01 18:29:02+00:00\n", |
| 81 | + "sigmavirus24/rack created at 2014-07-13 00:51:30+00:00\n", |
| 82 | + "sigmavirus24/recipes created at 2013-01-25 04:31:44+00:00\n", |
| 83 | + "sigmavirus24/repl_fun created at 2013-03-30 15:13:42+00:00\n", |
| 84 | + "sigmavirus24/requests created at 2012-06-15 13:47:06+00:00\n", |
| 85 | + "sigmavirus24/requests-data-schemes created at 2013-01-07 04:49:50+00:00\n", |
| 86 | + "sigmavirus24/requests-ntlm created at 2014-07-18 21:32:31+00:00\n", |
| 87 | + "sigmavirus24/requests-toolbelt created at 2013-12-29 21:19:08+00:00\n", |
| 88 | + "sigmavirus24/requests.rb created at 2013-02-01 02:52:28+00:00\n", |
| 89 | + "sigmavirus24/rfc3986 created at 2014-06-25 14:25:11+00:00\n", |
| 90 | + "sigmavirus24/shipit created at 2013-05-22 19:32:18+00:00\n", |
| 91 | + "sigmavirus24/solarized-pygment created at 2013-01-13 23:36:54+00:00\n", |
| 92 | + "sigmavirus24/sprunge.py created at 2012-06-09 14:19:26+00:00\n", |
| 93 | + "sigmavirus24/subscribed created at 2012-10-07 03:40:31+00:00\n", |
| 94 | + "sigmavirus24/Todo.txt-python created at 2012-09-16 19:31:58+00:00\n", |
| 95 | + "sigmavirus24/update_firefox created at 2012-06-19 01:56:02+00:00\n", |
| 96 | + "sigmavirus24/uritemplate created at 2013-05-14 16:52:08+00:00\n", |
| 97 | + "sigmavirus24/urllib3 created at 2013-12-04 03:04:13+00:00\n", |
| 98 | + "sigmavirus24/vcr created at 2013-09-18 03:15:42+00:00\n", |
| 99 | + "sigmavirus24/vim-stopsign created at 2013-09-03 13:26:03+00:00\n", |
| 100 | + "sigmavirus24/www.gittip.com created at 2013-01-16 13:15:38+00:00\n", |
| 101 | + "sigmavirus24/x11-ssh-askpass created at 2011-09-08 15:25:05+00:00\n", |
| 102 | + "sigmavirus24/zero created at 2013-09-15 02:17:30+00:00\n", |
| 103 | + "sigmavirus24/zero_buffer created at 2014-07-31 18:46:36+00:00\n" |
159 | 104 | ]
|
160 |
| - }, |
161 |
| - { |
162 |
| - "cell_type": "code", |
163 |
| - "collapsed": false, |
164 |
| - "input": [ |
165 |
| - "for repository in gh.repositories_by('sigmavirus24'):\n", |
166 |
| - " repository.create_fork('my-organization')" |
167 |
| - ], |
168 |
| - "language": "python", |
169 |
| - "metadata": {}, |
170 |
| - "outputs": [] |
171 | 105 | }
|
172 | 106 | ],
|
173 |
| - "metadata": {} |
| 107 | + "source": [ |
| 108 | + "for repository in github3.repositories_by('sigmavirus24'):\n", |
| 109 | + " print('{0} created at {0.created_at}'.format(repository))" |
| 110 | + ] |
| 111 | + }, |
| 112 | + { |
| 113 | + "cell_type": "markdown", |
| 114 | + "metadata": {}, |
| 115 | + "source": [ |
| 116 | + "You can also login and fork each of these repositories." |
| 117 | + ] |
| 118 | + }, |
| 119 | + { |
| 120 | + "cell_type": "code", |
| 121 | + "execution_count": 3, |
| 122 | + "metadata": {}, |
| 123 | + "outputs": [], |
| 124 | + "source": [ |
| 125 | + "gh = github3.login('username', 'password')" |
| 126 | + ] |
| 127 | + }, |
| 128 | + { |
| 129 | + "cell_type": "code", |
| 130 | + "execution_count": null, |
| 131 | + "metadata": {}, |
| 132 | + "outputs": [], |
| 133 | + "source": [ |
| 134 | + "for repository in gh.repositories_by('sigmavirus24'):\n", |
| 135 | + " repository.create_fork()" |
| 136 | + ] |
| 137 | + }, |
| 138 | + { |
| 139 | + "cell_type": "markdown", |
| 140 | + "metadata": {}, |
| 141 | + "source": [ |
| 142 | + "If you wanted to fork an organization to you, you could do the following: " |
| 143 | + ] |
| 144 | + }, |
| 145 | + { |
| 146 | + "cell_type": "code", |
| 147 | + "execution_count": null, |
| 148 | + "metadata": {}, |
| 149 | + "outputs": [], |
| 150 | + "source": [ |
| 151 | + "for repository in gh.repositories_by('sigmavirus24'):\n", |
| 152 | + " repository.create_fork('my-organization')" |
| 153 | + ] |
174 | 154 | }
|
175 |
| - ] |
| 155 | + ], |
| 156 | + "metadata": { |
| 157 | + "kernelspec": { |
| 158 | + "display_name": "Python 3", |
| 159 | + "language": "python", |
| 160 | + "name": "python3" |
| 161 | + }, |
| 162 | + "language_info": { |
| 163 | + "codemirror_mode": { |
| 164 | + "name": "ipython", |
| 165 | + "version": 3 |
| 166 | + }, |
| 167 | + "file_extension": ".py", |
| 168 | + "mimetype": "text/x-python", |
| 169 | + "name": "python", |
| 170 | + "nbconvert_exporter": "python", |
| 171 | + "pygments_lexer": "ipython3", |
| 172 | + "version": "3.8.8" |
| 173 | + } |
| 174 | + }, |
| 175 | + "nbformat": 4, |
| 176 | + "nbformat_minor": 1 |
176 | 177 | }
|
0 commit comments