Skip to content

Commit c744b0b

Browse files
Programmer-RD-AIProgrammer-RD-AI
andcommitted
Create kite_tutorial.ipynb
Co-Authored-By: Ranuga <[email protected]>
1 parent f3a9052 commit c744b0b

File tree

1 file changed

+182
-0
lines changed

1 file changed

+182
-0
lines changed

kite_tutorial.ipynb

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"![Logo](https://kite.com/kite-public/kite-plus-jlab-scaled.png)\n",
8+
"\n",
9+
"### Welcome to Kite's JupyterLab extension tutorial\n",
10+
"\n",
11+
"Kite gives you **ML-powered autocompletions** and **rich documentation** inside JupyterLab. This guide will teach you everything you need to know about Kite in 5 minutes or less.\n",
12+
"\n",
13+
"> 💡 _**Tip:** You can open this file at any time with the command `Kite: Open Tutorial` in JupyterLab's command palette._\n",
14+
"\n",
15+
"#### Before we start...\n",
16+
"\n",
17+
"Make sure that the Kite icon at the bottom of the window reads `Kite: ready`.\n",
18+
"\n",
19+
"![Kite icon](https://kite.com/kite-public/kite-status.png)\n",
20+
"\n",
21+
"* If it says `Kite: not running`, please start the Kite Engine first.\n",
22+
"* If it says `Kite: not installed`, please [download and install Kite](https://kite.com/download) first."
23+
]
24+
},
25+
{
26+
"cell_type": "markdown",
27+
"metadata": {},
28+
"source": [
29+
"#### Part 1: Autocompletions\n",
30+
"\n",
31+
"**Step 1a**<br/>\n",
32+
"Run the code cell below with all the necessary imports 👇"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"metadata": {},
39+
"outputs": [],
40+
"source": [
41+
"# Run me!\n",
42+
"import matplotlib.pyplot as plt\n",
43+
"import numpy as np\n",
44+
"import pandas as pd"
45+
]
46+
},
47+
{
48+
"cell_type": "markdown",
49+
"metadata": {},
50+
"source": [
51+
"**Step 1b**<br/>\n",
52+
"Let's try typing out some code to plot a sine graph. As you type, Kite will automatically show you completions for what you're going to type next.\n",
53+
"\n",
54+
"![Autocompletions](https://www.kite.com/kite-public/kite-jlab-autocompletions.gif)\n",
55+
"\n",
56+
"> 💡 _**Tip:** You can turn completions docs on and off in JupyterLab's command palette with the command `Kite: Toggle Docs Panel`._\n",
57+
"\n",
58+
"> 💡 _**Tip:** The starred completions ★ are from Kite Pro. You can [start your free Kite Pro trial](https://www.kite.com/pro/trial/) anytime. Afterwards, if you choose not to upgrade, you can still use Kite 100% for free._\n",
59+
"\n",
60+
"Try typing out the code yourself to see Kite's autocompletions in action.<br/>\n",
61+
"\n",
62+
"```python\n",
63+
"x = np.linspace(-np.pi, np.pi, 50)\n",
64+
"y = np.sin(x)\n",
65+
"plt.plot(x, y)\n",
66+
"```\n",
67+
"\n",
68+
"Type this code in the cell below 👇"
69+
]
70+
},
71+
{
72+
"cell_type": "code",
73+
"execution_count": null,
74+
"metadata": {},
75+
"outputs": [],
76+
"source": [
77+
"# Put code in me\n",
78+
"\n"
79+
]
80+
},
81+
{
82+
"cell_type": "markdown",
83+
"metadata": {},
84+
"source": [
85+
"#### Part 2: Manual completions\n",
86+
"\n",
87+
"You can still use JupyterLab's builtin kernel completions. These are particularly useful when you need to access a `DataFrame`'s column names.\n",
88+
"\n",
89+
"**Step 2a**<br/>\n",
90+
"First, run the code cell below to get some sample data to store in a `DataFrame` 👇"
91+
]
92+
},
93+
{
94+
"cell_type": "code",
95+
"execution_count": null,
96+
"metadata": {},
97+
"outputs": [],
98+
"source": [
99+
"# Run me!\n",
100+
"url = 'https://kite.com/kite-public/iris.csv'\n",
101+
"df = pd.read_csv(url)\n",
102+
"df.head()"
103+
]
104+
},
105+
{
106+
"cell_type": "markdown",
107+
"metadata": {},
108+
"source": [
109+
"**Step 2b**<br/>\n",
110+
"Let's plot a scatter graph of sepal length vs. sepal width. When you are accessing a `DataFrame`'s columns, you'll still need to hit `tab` to request completions from the kernel.\n",
111+
"\n",
112+
"![Manual completions](https://www.kite.com/kite-public/kite-jlab-manual-completions.gif)\n",
113+
"\n",
114+
"Try requesting kernel completions yourself.\n",
115+
"\n",
116+
"```python\n",
117+
"plt.scatter(df['sepal_length'], df['sepal_width'])\n",
118+
"```\n",
119+
"\n",
120+
"Type this code in the cell below, making sure to hit `tab` when you are filling in the column names 👇"
121+
]
122+
},
123+
{
124+
"cell_type": "code",
125+
"execution_count": null,
126+
"metadata": {},
127+
"outputs": [],
128+
"source": [
129+
"# Put code in me\n",
130+
"\n"
131+
]
132+
},
133+
{
134+
"cell_type": "markdown",
135+
"metadata": {},
136+
"source": [
137+
"#### Part 3: Copilot Documentation\n",
138+
"\n",
139+
"If you've enabled \"docs following cursor\" in the Copilot, the Copilot will automatically update with the documentation of the identifier underneath your cursor.\n",
140+
"\n",
141+
"![Autosearch](https://www.kite.com/kite-public/kite-jlab-autosearch.gif)\n",
142+
"\n",
143+
"**Step 3a**<br/>\n",
144+
"Try it yourself! Just click around in the code cells of this notebook and see the Copilot update automatically."
145+
]
146+
},
147+
{
148+
"cell_type": "markdown",
149+
"metadata": {},
150+
"source": [
151+
"#### The End\n",
152+
"\n",
153+
"Now you know everything you need to know about Kite's JupyterLab plugin. Kite is under active development and we expect to ship improvements and more features in the near future.\n",
154+
"\n",
155+
"In the meantime, if you experience bugs or have feature requests, feel free to open an issue in our [public GitHub repo](https://github.com/kiteco/issue-tracker).\n",
156+
"\n",
157+
"Happy coding!"
158+
]
159+
}
160+
],
161+
"metadata": {
162+
"kernelspec": {
163+
"display_name": "Python 3",
164+
"language": "python",
165+
"name": "python3"
166+
},
167+
"language_info": {
168+
"codemirror_mode": {
169+
"name": "ipython",
170+
"version": 3
171+
},
172+
"file_extension": ".py",
173+
"mimetype": "text/x-python",
174+
"name": "python",
175+
"nbconvert_exporter": "python",
176+
"pygments_lexer": "ipython3",
177+
"version": "3.7.6"
178+
}
179+
},
180+
"nbformat": 4,
181+
"nbformat_minor": 4
182+
}

0 commit comments

Comments
 (0)