{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# GitHub API usage example" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "%load_ext restmagic" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Some calls require personal API token: https://blog.github.com/2013-05-16-personal-api-tokens/" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "token = ''" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requests defaults are set.\n" ] } ], "source": [ "%%rest_root https://api.github.com\n", "Accept: application/vnd.github.v3+json\n", "Authorization: Token $token" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Get top 10 forked projects from the GitHub, for the \"ipython\" query" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | forks_count | \n", "watchers | \n", "
---|---|---|
full_name | \n", "\n", " | \n", " |
wesm/pydata-book | \n", "6052 | \n", "6585 | \n", "
donnemartin/data-science-ipython-notebooks | \n", "4047 | \n", "13738 | \n", "
ipython/ipython | \n", "3643 | \n", "13004 | \n", "
jrjohansson/scientific-python-lectures | \n", "1319 | \n", "2256 | \n", "
jdwittenauer/ipython-notebooks | \n", "1086 | \n", "1935 | \n", "
jupyterhub/jupyterhub | \n", "827 | \n", "3631 | \n", "
PipelineAI/pipeline | \n", "775 | \n", "2950 | \n", "
powerline/powerline | \n", "741 | \n", "9322 | \n", "
ogrisel/parallel_ml_tutorial | \n", "571 | \n", "1444 | \n", "
jadianes/spark-py-notebooks | \n", "570 | \n", "832 | \n", "