{ "cells": [ { "cell_type": "code", "execution_count": 6, "id": "b5a9aa6c", "metadata": {}, "outputs": [], "source": [ "from github import Github\n", "from getpass import getpass\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "id": "88efc658", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Enter access token········\n" ] } ], "source": [ "g = Github(getpass(\"Enter access token\"))" ] }, { "cell_type": "code", "execution_count": 41, "id": "9404d100", "metadata": {}, "outputs": [], "source": [ "def get_candidates():\n", " for result in g.search_code(\"filename:_targets.R extension:.R\"):\n", " yield result.name, result.repository.html_url, result.repository.stargazers_count" ] }, { "cell_type": "code", "execution_count": 42, "id": "3f5ca887", "metadata": {}, "outputs": [], "source": [ "df = pd.DataFrame.from_records(\n", " get_candidates()\n", ").rename(\n", " columns = {0: \"filename\", 1: \"repo_url\", 2: \"stars\"}\n", ").query(\n", " \"filename == '_targets.R'\"\n", ").sort_values(\n", " \"stars\", ascending=False\n", ")" ] }, { "cell_type": "code", "execution_count": 43, "id": "8125999b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
repo_urlstars
2https://github.com/adamaltmejd/covid88
146https://github.com/robjhyndman/CV81
590https://github.com/MilesMcBain/tflow77
564https://github.com/xmarquez/democracyData71
496https://github.com/wlandau/targets-minimal56
176https://github.com/InseeFrLab/utilitR51
15https://github.com/andrewheiss/evalf22.classes.andrewheiss.com49
97https://github.com/USGS-VIZLAB/chart-challenge-2241
261https://github.com/USGS-VIZLAB/chart-challenge-2241
223https://github.com/USGS-VIZLAB/chart-challenge-2241
112https://github.com/USGS-VIZLAB/chart-challenge-2241
274https://github.com/USGS-VIZLAB/chart-challenge-2241
681https://github.com/USGS-VIZLAB/chart-challenge-2241
348https://github.com/juba/tidyverse38
253https://github.com/andrewheiss/bayesf22.classes.andrewheiss.com36
445https://github.com/fdhidalgo/geocode_br_polling_stations31
315https://github.com/tjmahr/notestar29
530https://github.com/svmiller/steveproj29
589https://github.com/nhs-r-community/demos-and-how-tos28
610https://github.com/nhs-r-community/demos-and-how-tos28
265https://github.com/noamross/reprotemplate25
35https://github.com/the-markup/investigation-prediction-bias24
271https://github.com/andrewheiss/who-cares-about-crackdown24
521https://github.com/wlandau/targets-stan23
550https://github.com/ecohealthalliance/container-template23
447https://github.com/USGS-VIZLAB/flow-tiles21
480https://github.com/InseeFrLab/lockdown-maps-R20
45https://github.com/wlandau/targets-four-minutes19
179https://github.com/goldingn/neuts2efficacy18
312https://github.com/andrewheiss/evalsp23.classes.andrewheiss.com18
281https://github.com/ropensci/roweb316
570https://github.com/crsh/reproducible-research-practices-workshop16
536https://github.com/andrewheiss/nonprofitf22.classes.andrewheiss.com15
378https://github.com/emptyfield-ds/r_teaching_warehouse15
69https://github.com/USGS-VIZLAB/viz-scratch15
219https://github.com/emptyfield-ds/r_teaching_warehouse15
343https://github.com/wlandau/targetsketch14
91https://github.com/saturncloud/examples14
669https://github.com/boyiguo1/Tutorial-Residential_Segregation_Score13
368https://github.com/databio/unitar13
557https://github.com/databio/unitar13
85https://github.com/LungCellAtlas/HLCA_reproducibility13
302https://github.com/databio/unitar13
677https://github.com/databio/unitar13
676https://github.com/databio/unitar13
282https://github.com/noamross/targets-minio-versioning12
593https://github.com/sol-eng/targets-deployment-rsc11
515https://github.com/wlandau/targets-keras11
357https://github.com/malcolmbarrett/mastering_r_for_epi10
254https://github.com/r4ds/bookclub-tmwr10
\n", "
" ], "text/plain": [ " repo_url \n", "2 https://github.com/adamaltmejd/covid \\\n", "146 https://github.com/robjhyndman/CV \n", "590 https://github.com/MilesMcBain/tflow \n", "564 https://github.com/xmarquez/democracyData \n", "496 https://github.com/wlandau/targets-minimal \n", "176 https://github.com/InseeFrLab/utilitR \n", "15 https://github.com/andrewheiss/evalf22.classes.andrewheiss.com \n", "97 https://github.com/USGS-VIZLAB/chart-challenge-22 \n", "261 https://github.com/USGS-VIZLAB/chart-challenge-22 \n", "223 https://github.com/USGS-VIZLAB/chart-challenge-22 \n", "112 https://github.com/USGS-VIZLAB/chart-challenge-22 \n", "274 https://github.com/USGS-VIZLAB/chart-challenge-22 \n", "681 https://github.com/USGS-VIZLAB/chart-challenge-22 \n", "348 https://github.com/juba/tidyverse \n", "253 https://github.com/andrewheiss/bayesf22.classes.andrewheiss.com \n", "445 https://github.com/fdhidalgo/geocode_br_polling_stations \n", "315 https://github.com/tjmahr/notestar \n", "530 https://github.com/svmiller/steveproj \n", "589 https://github.com/nhs-r-community/demos-and-how-tos \n", "610 https://github.com/nhs-r-community/demos-and-how-tos \n", "265 https://github.com/noamross/reprotemplate \n", "35 https://github.com/the-markup/investigation-prediction-bias \n", "271 https://github.com/andrewheiss/who-cares-about-crackdown \n", "521 https://github.com/wlandau/targets-stan \n", "550 https://github.com/ecohealthalliance/container-template \n", "447 https://github.com/USGS-VIZLAB/flow-tiles \n", "480 https://github.com/InseeFrLab/lockdown-maps-R \n", "45 https://github.com/wlandau/targets-four-minutes \n", "179 https://github.com/goldingn/neuts2efficacy \n", "312 https://github.com/andrewheiss/evalsp23.classes.andrewheiss.com \n", "281 https://github.com/ropensci/roweb3 \n", "570 https://github.com/crsh/reproducible-research-practices-workshop \n", "536 https://github.com/andrewheiss/nonprofitf22.classes.andrewheiss.com \n", "378 https://github.com/emptyfield-ds/r_teaching_warehouse \n", "69 https://github.com/USGS-VIZLAB/viz-scratch \n", "219 https://github.com/emptyfield-ds/r_teaching_warehouse \n", "343 https://github.com/wlandau/targetsketch \n", "91 https://github.com/saturncloud/examples \n", "669 https://github.com/boyiguo1/Tutorial-Residential_Segregation_Score \n", "368 https://github.com/databio/unitar \n", "557 https://github.com/databio/unitar \n", "85 https://github.com/LungCellAtlas/HLCA_reproducibility \n", "302 https://github.com/databio/unitar \n", "677 https://github.com/databio/unitar \n", "676 https://github.com/databio/unitar \n", "282 https://github.com/noamross/targets-minio-versioning \n", "593 https://github.com/sol-eng/targets-deployment-rsc \n", "515 https://github.com/wlandau/targets-keras \n", "357 https://github.com/malcolmbarrett/mastering_r_for_epi \n", "254 https://github.com/r4ds/bookclub-tmwr \n", "\n", " stars \n", "2 88 \n", "146 81 \n", "590 77 \n", "564 71 \n", "496 56 \n", "176 51 \n", "15 49 \n", "97 41 \n", "261 41 \n", "223 41 \n", "112 41 \n", "274 41 \n", "681 41 \n", "348 38 \n", "253 36 \n", "445 31 \n", "315 29 \n", "530 29 \n", "589 28 \n", "610 28 \n", "265 25 \n", "35 24 \n", "271 24 \n", "521 23 \n", "550 23 \n", "447 21 \n", "480 20 \n", "45 19 \n", "179 18 \n", "312 18 \n", "281 16 \n", "570 16 \n", "536 15 \n", "378 15 \n", "69 15 \n", "219 15 \n", "343 14 \n", "91 14 \n", "669 13 \n", "368 13 \n", "557 13 \n", "85 13 \n", "302 13 \n", "677 13 \n", "676 13 \n", "282 12 \n", "593 11 \n", "515 11 \n", "357 10 \n", "254 10 " ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.set_option('max_colwidth', 200)\n", "pd.set_option('display.max_rows', None)\n", "df.iloc[:50, 1:]" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }