Skip to content

Commit 47b2285

Browse files
committed
Merge remote-tracking branch 'origin/master' into patch-1
2 parents bf3d676 + 8ff8b48 commit 47b2285

File tree

10 files changed

+892
-744
lines changed

10 files changed

+892
-744
lines changed

00_core.ipynb

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"class _GhVerb(_GhObj):\n",
110110
" __slots__ = 'path,verb,tag,name,summary,url,route_ps,params,data,preview,client,__doc__'.split(',')\n",
111111
" def __init__(self, path, verb, oper, summary, url, params, data, preview, client, kwargs):\n",
112-
" tag,name = oper.split('/')\n",
112+
" tag,*name = oper.split('/')\n",
113+
" name = '__'.join(name)\n",
113114
" name = name.replace('-','_')\n",
114115
" path,_,_ = partial_format(path, **kwargs)\n",
115116
" route_ps = stringfmt_names(path)\n",
@@ -290,18 +291,18 @@
290291
"- node_id: MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy\n",
291292
"- url: https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master\n",
292293
"- object: \n",
293-
" - sha: 4fabc2fb4686c8b742511247372c5bc9f5a788df\n",
294+
" - sha: 77d2b8f95ca0ee35a4b24165008d698653459d5d\n",
294295
" - type: commit\n",
295-
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/4fabc2fb4686c8b742511247372c5bc9f5a788df"
296+
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/77d2b8f95ca0ee35a4b24165008d698653459d5d"
296297
],
297298
"text/plain": [
298299
"- ref: refs/heads/master\n",
299300
"- node_id: MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy\n",
300301
"- url: https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master\n",
301302
"- object: \n",
302-
" - sha: 4fabc2fb4686c8b742511247372c5bc9f5a788df\n",
303+
" - sha: 77d2b8f95ca0ee35a4b24165008d698653459d5d\n",
303304
" - type: commit\n",
304-
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/4fabc2fb4686c8b742511247372c5bc9f5a788df"
305+
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/77d2b8f95ca0ee35a4b24165008d698653459d5d"
305306
]
306307
},
307308
"execution_count": null,
@@ -359,18 +360,18 @@
359360
"- node_id: MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy\n",
360361
"- url: https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master\n",
361362
"- object: \n",
362-
" - sha: 4fabc2fb4686c8b742511247372c5bc9f5a788df\n",
363+
" - sha: 77d2b8f95ca0ee35a4b24165008d698653459d5d\n",
363364
" - type: commit\n",
364-
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/4fabc2fb4686c8b742511247372c5bc9f5a788df"
365+
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/77d2b8f95ca0ee35a4b24165008d698653459d5d"
365366
],
366367
"text/plain": [
367368
"- ref: refs/heads/master\n",
368369
"- node_id: MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy\n",
369370
"- url: https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master\n",
370371
"- object: \n",
371-
" - sha: 4fabc2fb4686c8b742511247372c5bc9f5a788df\n",
372+
" - sha: 77d2b8f95ca0ee35a4b24165008d698653459d5d\n",
372373
" - type: commit\n",
373-
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/4fabc2fb4686c8b742511247372c5bc9f5a788df"
374+
" - url: https://api.github.com/repos/fastai/ghapi-test/git/commits/77d2b8f95ca0ee35a4b24165008d698653459d5d"
374375
]
375376
},
376377
"execution_count": null,
@@ -405,7 +406,7 @@
405406
"name": "stdout",
406407
"output_type": "stream",
407408
"text": [
408-
"Quota remaining: 4872 of 5000\n"
409+
"Quota remaining: 57 of 60\n"
409410
]
410411
},
411412
{
@@ -441,7 +442,7 @@
441442
{
442443
"data": {
443444
"text/plain": [
444-
"'4872'"
445+
"'57'"
445446
]
446447
},
447448
"execution_count": null,
@@ -505,6 +506,7 @@
505506
"- [actions](https://docs.github.com/en/free-pro-team@latest/rest/reference/actions)\n",
506507
"- [activity](https://docs.github.com/en/free-pro-team@latest/rest/reference/activity)\n",
507508
"- [apps](https://docs.github.com/en/free-pro-team@latest/rest/reference/apps)\n",
509+
"- [audit_log](https://docs.github.com/en/free-pro-team@latest/rest/reference/audit-log)\n",
508510
"- [billing](https://docs.github.com/en/free-pro-team@latest/rest/reference/billing)\n",
509511
"- [checks](https://docs.github.com/en/free-pro-team@latest/rest/reference/checks)\n",
510512
"- [code_scanning](https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning)\n",
@@ -522,6 +524,7 @@
522524
"- [migrations](https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations)\n",
523525
"- [oauth_authorizations](https://docs.github.com/en/free-pro-team@latest/rest/reference/oauth-authorizations)\n",
524526
"- [orgs](https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs)\n",
527+
"- [packages](https://docs.github.com/en/free-pro-team@latest/rest/reference/packages)\n",
525528
"- [projects](https://docs.github.com/en/free-pro-team@latest/rest/reference/projects)\n",
526529
"- [pulls](https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls)\n",
527530
"- [rate_limit](https://docs.github.com/en/free-pro-team@latest/rest/reference/rate-limit)\n",
@@ -534,7 +537,7 @@
534537
"- [users](https://docs.github.com/en/free-pro-team@latest/rest/reference/users)"
535538
],
536539
"text/plain": [
537-
"<__main__.GhApi at 0x7fd5184f73a0>"
540+
"<__main__.GhApi at 0x7fdc20513640>"
538541
]
539542
},
540543
"execution_count": null,
@@ -554,12 +557,12 @@
554557
{
555558
"data": {
556559
"text/markdown": [
557-
"- [codes-of-conduct.get_all_codes_of_conduct](https://docs.github.com/v3/codes_of_conduct/#get-all-codes-of-conduct)(): *Get all codes of conduct*\n",
558-
"- [codes-of-conduct.get_conduct_code](https://docs.github.com/v3/codes_of_conduct/#get-a-code-of-conduct)(key): *Get a code of conduct*\n",
559-
"- [codes-of-conduct.get_for_repo](https://docs.github.com/v3/codes_of_conduct/#get-the-code-of-conduct-for-a-repository)(): *Get the code of conduct for a repository*"
560+
"- [codes-of-conduct.get_all_codes_of_conduct](https://docs.github.com/rest/reference/codes_of_conduct/#get-all-codes-of-conduct)(): *Get all codes of conduct*\n",
561+
"- [codes-of-conduct.get_conduct_code](https://docs.github.com/rest/reference/codes_of_conduct/#get-a-code-of-conduct)(key): *Get a code of conduct*\n",
562+
"- [codes-of-conduct.get_for_repo](https://docs.github.com/rest/reference/codes_of_conduct/#get-the-code-of-conduct-for-a-repository)(): *Get the code of conduct for a repository*"
560563
],
561564
"text/plain": [
562-
"<__main__._GhVerbGroup at 0x7fd5184f73d0>"
565+
"<__main__._GhVerbGroup at 0x7fdc205139a0>"
563566
]
564567
},
565568
"execution_count": null,
@@ -709,7 +712,7 @@
709712
"- [git.get_tree](https://docs.github.com/rest/reference/git#get-a-tree)(tree_sha, recursive): *Get a tree*"
710713
],
711714
"text/plain": [
712-
"<__main__._GhVerbGroup at 0x7fd5184e58b0>"
715+
"<__main__._GhVerbGroup at 0x7fdc00dac4f0>"
713716
]
714717
},
715718
"execution_count": null,
@@ -845,7 +848,7 @@
845848
{
846849
"data": {
847850
"text/plain": [
848-
"2"
851+
"6"
849852
]
850853
},
851854
"execution_count": null,
@@ -880,7 +883,7 @@
880883
"name": "stdout",
881884
"output_type": "stream",
882885
"text": [
883-
"2020-12-28T12:52:59Z -> 2020-12-28 12:52:59\n"
886+
"2021-04-28T16:52:35Z -> 2021-04-28 16:52:35\n"
884887
]
885888
}
886889
],
@@ -1480,7 +1483,6 @@
14801483
"Converted 50_fullapi.ipynb.\n",
14811484
"Converted 80_tutorial_actions.ipynb.\n",
14821485
"Converted 90_build_lib.ipynb.\n",
1483-
"Converted Untitled.ipynb.\n",
14841486
"Converted ghapi demo.ipynb.\n",
14851487
"Converted index.ipynb.\n"
14861488
]

03_page.ipynb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
"cell_type": "markdown",
139139
"metadata": {},
140140
"source": [
141-
"However, `per_page` has a maximum of `100`, so if you want more, you'll have to pass `page=` to get pages beyond the first. An easy way to iterate through all pages is to use `paged`."
141+
"However, `per_page` has a maximum of `100`, so if you want more, you'll have to pass `page=` to get pages beyond the first. An easy way to iterate through all pages is to use `paged`. `paged` returns a generator "
142142
]
143143
},
144144
{
@@ -191,7 +191,7 @@
191191
{
192192
"data": {
193193
"text/plain": [
194-
"(30, 'fast-image')"
194+
"(30, 'docs')"
195195
]
196196
},
197197
"execution_count": null,
@@ -200,15 +200,15 @@
200200
}
201201
],
202202
"source": [
203-
"repos = api.repos.list_for_org('fastai')\n",
203+
"repos = api.repos.list_for_org(org='fastai')\n",
204204
"len(repos),repos[0].name"
205205
]
206206
},
207207
{
208208
"cell_type": "markdown",
209209
"metadata": {},
210210
"source": [
211-
"To convert this operation into a Python iterator, pass the operation itself, along with any arguments (either keyword or positional) to `paged`:"
211+
"To convert this operation into a Python iterator, pass the operation itself, along with any arguments (either keyword or positional) to `paged`. Note how the function and arguments are passed separately:"
212212
]
213213
},
214214
{
@@ -217,14 +217,14 @@
217217
"metadata": {},
218218
"outputs": [],
219219
"source": [
220-
"repos = paged(api.repos.list_for_org, 'fastai')"
220+
"repos = paged(api.repos.list_for_org, org='fastai')"
221221
]
222222
},
223223
{
224224
"cell_type": "markdown",
225225
"metadata": {},
226226
"source": [
227-
"You can now iterate through `repos` using Python, e.g:"
227+
"Note that the object returned from `paged` is a generator. You can iterate through this generator `repos` in the normal way:"
228228
]
229229
},
230230
{
@@ -236,10 +236,9 @@
236236
"name": "stdout",
237237
"output_type": "stream",
238238
"text": [
239-
"30 fast-image\n",
240-
"30 fastforest\n",
241-
"30 .github\n",
242-
"3 tweetrel\n"
239+
"30 docs\n",
240+
"30 fastscript\n",
241+
"25 wireguard-fast\n"
243242
]
244243
}
245244
],

0 commit comments

Comments
 (0)