generated from fastai/nbdev_template
/
tutorial_api.html
53 lines (35 loc) · 2.19 KB
/
tutorial_api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
title: Getting started with the GitHub API
keywords: fastai
sidebar: home_sidebar
nb_path: "tutorial_api.ipynb"
---
<!--
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: tutorial_api.ipynb
# command to build the docs after a change: nbdev_build_docs
-->
<div class="container" id="notebook-container">
{% raw %}
<div class="cell border-box-sizing code_cell rendered">
</div>
{% endraw %}
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Initial-setup">Initial setup<a class="anchor-link" href="#Initial-setup"> </a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>To get started, you need a GitHub personal access token, which is a secret code used to access your account. If you don't have one, <a href="https://github.com/settings/tokens/new">click here</a> to create one. You'll be asked to enter a name -- choose anything you like, for instance "<em>ghapi</em>". You'll also be asked to choose "scopes"; this limits what you'll be able to do with the API using this token. If you're not sure, click "<em>repo</em>" "<em>gist</em>", "<em>notifications</em>", and "<em>workflow</em>". Then click "Generate Token" at the bottom of the screen, and copy the token (the long string of letters and numbers shown). You can easily do that by clicking the little clipboard icon next to the token.</p>
<p>You'll need to pass that token to <a href="/core.html#GhApi"><code>GhApi</code></a>. Rather than pasting it into every script, it's easiest to save it as an environment variable. If you save it as <code>$GITHUB_TOKEN</code> then it will be most convenient, so add this to the end of your <code>.bashrc</code> or <code>.zshrc</code> file:</p>
<pre><code>export GITHUB_TOKEN=xxx
</code></pre>
<p>...replacing the <code>xxx</code> with the token you just copied. Don't forget to <code>source</code> that file after you change it.</p>
</div>
</div>
</div>
</div>