Using the JupyterLab plugin for Python
In this article, you'll learn how to access all the features the JupyterLab plugin has to offer for Python.
Prerequisites
The only prerequisites are that you have Kite Engine running and the JupyterLab plugin installed. If you don't have the JupyterLab plugin installed, you can learn how to do so here.
Note: If you installed the JupyterLab plugin while JupyterLab was already running, you'll need to restart JupyterLab for the plugin to activate.
Checking the Status of Kite
If Kite is installed properly, you should see a small Kite logo at the bottom left corner of the JupyterLab window.
There are a handful of possible states Kite can be in, as described in the following table:
Message | Description |
Kite: not installed | Kite Engine is not installed. |
Kite: not running | Kite Engine is not running. |
Kite: indexing | Kite Engine is analyzing your code. |
Kite: ready | Kite is ready to go — start coding! |
No message | This typically means that you are coding in an unsaved file or a filetype not yet supported by Kite. |
Note: If you're running Kite for the first time, it may take several minutes for Kite to finish indexing your codebase.
If Kite is not installed, you'll need to download and install it first. If Kite is installed but not running, please start the Kite Engine before continuing with the rest of this guide.
Writing Code and Accessing Features
In the following sections, the $
character indicates the position of your editor's text cursor.
Completions
To start, open a Python notebook. Make sure that this file has been saved with a .ipynb
extension. Now type the following code:
import n$
A list of suggested completions should automatically appear.
💡
Tip: You can toggle the completions documentation panel on/off with the command
Kite: Toggle Docs Panel
in JupyterLab's command palette.
Kite can provide completions for Python keywords, name expressions or attribute expressions. The example above illustrates a name expression completion. An example of an attribute completion would be:
import numpy as np np.$
In the case of name and attribute completions, Kite will also provide the kind of value represented by the completion (e.g. module
or function
) as well as a short snippet of the documentation if available.
Kite Pro completions
If you have upgraded to Kite Pro, Kite may suggest completions that can complete multiple words at once. For example, Kite can suggest completions for generic code structure, such as control structures and variable assignments, to name a few.
You can learn more about Kite Pro here.
Viewing documentation
Kite can also quickly retrieve documentation for the code you are working with. If you have enabled "docs are following cursor" in the Copilot, then the Copilot will automatically update with the documentation of the identifier underneath your cursor.
Commands
The JupyterLab plugin provides a number of commands for ease of use. To access them, open JupyterLab's command palette, and search for "Kite:". The commands provided are:
Command | Description |
Kite: Engine Settings |
Opens the Kite Engine application's settings. |
Kite: Help |
Opens the help articles for the JupyterLab plugin. |
Kite: Open Copilot |
Opens the Kite Copilot. |
Kite: Toggle Docs Panel |
Toggles the completions documentation panel on/off. |
Kite: Tutorial |
Opens an interactive tutorial for the JupyterLab plugin directly in JupyterLab. |