|
33 | 33 | "from urllib.request import Request\n", |
34 | 34 | "from urllib.error import HTTPError\n", |
35 | 35 | "from urllib.parse import quote\n", |
36 | | - "from datetime import datetime,timedelta\n", |
| 36 | + "from datetime import datetime, timedelta, timezone\n", |
37 | 37 | "from pprint import pprint\n", |
38 | 38 | "from time import sleep\n", |
39 | 39 | "import os, shutil, tempfile, git" |
|
272 | 272 | "text/markdown": [ |
273 | 273 | "---\n", |
274 | 274 | "\n", |
275 | | - "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L123){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 275 | + "[source](https://github.com/fastai/ghapi/blob/main/ghapi/core.py#L123){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
276 | 276 | "\n", |
277 | 277 | "### GhApi.__call__\n", |
278 | 278 | "\n", |
|
285 | 285 | "text/plain": [ |
286 | 286 | "---\n", |
287 | 287 | "\n", |
288 | | - "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L123){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 288 | + "[source](https://github.com/fastai/ghapi/blob/main/ghapi/core.py#L123){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
289 | 289 | "\n", |
290 | 290 | "### GhApi.__call__\n", |
291 | 291 | "\n", |
|
331 | 331 | "text/markdown": [ |
332 | 332 | "```json\n", |
333 | 333 | "{ 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
334 | | - " 'object': { 'sha': '276fb019036d9fbc868313f243cc4bf88f8255a3',\n", |
| 334 | + " 'object': { 'sha': '958659bf10a8c275fb04f2f6832f1a0f4d07fa85',\n", |
335 | 335 | " 'type': 'commit',\n", |
336 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/276fb019036d9fbc868313f243cc4bf88f8255a3'},\n", |
| 336 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/958659bf10a8c275fb04f2f6832f1a0f4d07fa85'},\n", |
337 | 337 | " 'ref': 'refs/heads/master',\n", |
338 | 338 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master'}\n", |
339 | 339 | "```" |
|
342 | 342 | "{'ref': 'refs/heads/master',\n", |
343 | 343 | " 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
344 | 344 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master',\n", |
345 | | - " 'object': {'sha': '276fb019036d9fbc868313f243cc4bf88f8255a3',\n", |
| 345 | + " 'object': {'sha': '958659bf10a8c275fb04f2f6832f1a0f4d07fa85',\n", |
346 | 346 | " 'type': 'commit',\n", |
347 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/276fb019036d9fbc868313f243cc4bf88f8255a3'}}" |
| 347 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/958659bf10a8c275fb04f2f6832f1a0f4d07fa85'}}" |
348 | 348 | ] |
349 | 349 | }, |
350 | 350 | "execution_count": null, |
|
367 | 367 | "text/markdown": [ |
368 | 368 | "---\n", |
369 | 369 | "\n", |
370 | | - "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L147){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 370 | + "[source](https://github.com/fastai/ghapi/blob/main/ghapi/core.py#L147){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
371 | 371 | "\n", |
372 | 372 | "### GhApi.__getitem__\n", |
373 | 373 | "\n", |
|
378 | 378 | "text/plain": [ |
379 | 379 | "---\n", |
380 | 380 | "\n", |
381 | | - "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L147){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 381 | + "[source](https://github.com/fastai/ghapi/blob/main/ghapi/core.py#L147){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
382 | 382 | "\n", |
383 | 383 | "### GhApi.__getitem__\n", |
384 | 384 | "\n", |
|
413 | 413 | "text/markdown": [ |
414 | 414 | "```json\n", |
415 | 415 | "{ 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
416 | | - " 'object': { 'sha': '276fb019036d9fbc868313f243cc4bf88f8255a3',\n", |
| 416 | + " 'object': { 'sha': '958659bf10a8c275fb04f2f6832f1a0f4d07fa85',\n", |
417 | 417 | " 'type': 'commit',\n", |
418 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/276fb019036d9fbc868313f243cc4bf88f8255a3'},\n", |
| 418 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/958659bf10a8c275fb04f2f6832f1a0f4d07fa85'},\n", |
419 | 419 | " 'ref': 'refs/heads/master',\n", |
420 | 420 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master'}\n", |
421 | 421 | "```" |
|
424 | 424 | "{'ref': 'refs/heads/master',\n", |
425 | 425 | " 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
426 | 426 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master',\n", |
427 | | - " 'object': {'sha': '276fb019036d9fbc868313f243cc4bf88f8255a3',\n", |
| 427 | + " 'object': {'sha': '958659bf10a8c275fb04f2f6832f1a0f4d07fa85',\n", |
428 | 428 | " 'type': 'commit',\n", |
429 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/276fb019036d9fbc868313f243cc4bf88f8255a3'}}" |
| 429 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/958659bf10a8c275fb04f2f6832f1a0f4d07fa85'}}" |
430 | 430 | ] |
431 | 431 | }, |
432 | 432 | "execution_count": null, |
|
460 | 460 | { |
461 | 461 | "data": { |
462 | 462 | "text/plain": [ |
463 | | - "'276fb019036d9fbc868313f243cc4bf88f8255a3'" |
| 463 | + "'958659bf10a8c275fb04f2f6832f1a0f4d07fa85'" |
464 | 464 | ] |
465 | 465 | }, |
466 | 466 | "execution_count": null, |
|
497 | 497 | "name": "stdout", |
498 | 498 | "output_type": "stream", |
499 | 499 | "text": [ |
500 | | - "Quota remaining: 4996 of 5000\n" |
| 500 | + "Quota remaining: 4907 of 5000\n" |
501 | 501 | ] |
502 | 502 | }, |
503 | 503 | { |
|
533 | 533 | { |
534 | 534 | "data": { |
535 | 535 | "text/plain": [ |
536 | | - "'4996'" |
| 536 | + "'4907'" |
537 | 537 | ] |
538 | 538 | }, |
539 | 539 | "execution_count": null, |
|
599 | 599 | "- [api_insights](https://docs.github.com/rest/reference/api-insights)\n", |
600 | 600 | "- [apps](https://docs.github.com/rest/reference/apps)\n", |
601 | 601 | "- [billing](https://docs.github.com/rest/reference/billing)\n", |
| 602 | + "- [campaigns](https://docs.github.com/rest/reference/campaigns)\n", |
602 | 603 | "- [checks](https://docs.github.com/rest/reference/checks)\n", |
603 | 604 | "- [classroom](https://docs.github.com/rest/reference/classroom)\n", |
604 | 605 | "- [code_scanning](https://docs.github.com/rest/reference/code-scanning)\n", |
605 | 606 | "- [code_security](https://docs.github.com/rest/reference/code-security)\n", |
606 | 607 | "- [codes_of_conduct](https://docs.github.com/rest/reference/codes-of-conduct)\n", |
607 | 608 | "- [codespaces](https://docs.github.com/rest/reference/codespaces)\n", |
608 | 609 | "- [copilot](https://docs.github.com/rest/reference/copilot)\n", |
| 610 | + "- [credentials](https://docs.github.com/rest/reference/credentials)\n", |
609 | 611 | "- [dependabot](https://docs.github.com/rest/reference/dependabot)\n", |
610 | 612 | "- [dependency_graph](https://docs.github.com/rest/reference/dependency-graph)\n", |
611 | 613 | "- [emojis](https://docs.github.com/rest/reference/emojis)\n", |
|
624 | 626 | "- [packages](https://docs.github.com/rest/reference/packages)\n", |
625 | 627 | "- [private_registries](https://docs.github.com/rest/reference/private-registries)\n", |
626 | 628 | "- [projects](https://docs.github.com/rest/reference/projects)\n", |
| 629 | + "- [projects_classic](https://docs.github.com/rest/reference/projects-classic)\n", |
627 | 630 | "- [pulls](https://docs.github.com/rest/reference/pulls)\n", |
628 | 631 | "- [rate_limit](https://docs.github.com/rest/reference/rate-limit)\n", |
629 | 632 | "- [reactions](https://docs.github.com/rest/reference/reactions)\n", |
|
949 | 952 | "execution_count": null, |
950 | 953 | "metadata": {}, |
951 | 954 | "outputs": [ |
952 | | - { |
953 | | - "name": "stderr", |
954 | | - "output_type": "stream", |
955 | | - "text": [ |
956 | | - "/var/folders/hz/fg03h5c13x96l0g9420_qvlm0000gn/T/ipykernel_71467/3678695839.py:1: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).\n", |
957 | | - " dt = date2gh(datetime.utcnow() - timedelta(weeks=4))\n" |
958 | | - ] |
959 | | - }, |
960 | 955 | { |
961 | 956 | "data": { |
962 | 957 | "text/plain": [ |
963 | | - "1" |
| 958 | + "0" |
964 | 959 | ] |
965 | 960 | }, |
966 | 961 | "execution_count": null, |
|
969 | 964 | } |
970 | 965 | ], |
971 | 966 | "source": [ |
972 | | - "dt = date2gh(datetime.utcnow() - timedelta(weeks=4))\n", |
| 967 | + "dt = date2gh(datetime.now(timezone.utc) - timedelta(weeks=4))\n", |
973 | 968 | "issues = GhApi('fastai').issues.list_for_repo(repo='fastcore', since=dt)\n", |
974 | 969 | "len(issues)" |
975 | 970 | ] |
|
990 | 985 | "cell_type": "code", |
991 | 986 | "execution_count": null, |
992 | 987 | "metadata": {}, |
993 | | - "outputs": [ |
994 | | - { |
995 | | - "name": "stdout", |
996 | | - "output_type": "stream", |
997 | | - "text": [ |
998 | | - "2023-06-29T17:44:49Z -> 2023-06-29 17:44:49\n" |
999 | | - ] |
1000 | | - } |
1001 | | - ], |
| 988 | + "outputs": [], |
1002 | 989 | "source": [ |
1003 | | - "created = issues[0].created_at\n", |
1004 | | - "print(created, '->', gh2date(created))" |
| 990 | + "# created = issues[0].created_at\n", |
| 991 | + "# print(created, '->', gh2date(created))" |
1005 | 992 | ] |
1006 | 993 | }, |
1007 | 994 | { |
|
1101 | 1088 | "name": "stdout", |
1102 | 1089 | "output_type": "stream", |
1103 | 1090 | "text": [ |
1104 | | - "https://gist.github.com/KeremTurgutlu/81232c80389c9257a82bcf4ddeaffac0\n" |
| 1091 | + "https://gist.github.com/jph00/634c4553fac5fdd3b2d810dcdae2d841\n" |
1105 | 1092 | ] |
1106 | 1093 | } |
1107 | 1094 | ], |
|
1139 | 1126 | "name": "stdout", |
1140 | 1127 | "output_type": "stream", |
1141 | 1128 | "text": [ |
1142 | | - "https://gist.github.com/KeremTurgutlu/82af4d178db85fcb585029854b495bae\n" |
| 1129 | + "https://gist.github.com/jph00/dbd28d7ef14117b4aa4b0d8fc9a9aa81\n" |
1143 | 1130 | ] |
1144 | 1131 | } |
1145 | 1132 | ], |
|
1156 | 1143 | { |
1157 | 1144 | "data": { |
1158 | 1145 | "text/plain": [ |
1159 | | - "'some image\\n\\n'" |
| 1146 | + "'some image\\n\\n'" |
1160 | 1147 | ] |
1161 | 1148 | }, |
1162 | 1149 | "execution_count": null, |
|
1299 | 1286 | "text/markdown": [ |
1300 | 1287 | "---\n", |
1301 | 1288 | "\n", |
1302 | | - "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L173){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 1289 | + "[source](https://github.com/fastai/ghapi/blob/main/ghapi/core.py#L191){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
1303 | 1290 | "\n", |
1304 | 1291 | "### GhApi.delete_release\n", |
1305 | 1292 | "\n", |
|
1310 | 1297 | "text/plain": [ |
1311 | 1298 | "---\n", |
1312 | 1299 | "\n", |
1313 | | - "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L173){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 1300 | + "[source](https://github.com/fastai/ghapi/blob/main/ghapi/core.py#L191){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
1314 | 1301 | "\n", |
1315 | 1302 | "### GhApi.delete_release\n", |
1316 | 1303 | "\n", |
|
0 commit comments