Power up the almost useless code suggestions in JupyterLab
As a data scientist, you almost surely use a form of Jupyter Notebooks. Hopefully, you have moved over to the goodness of JupyterLab with its integrated sidebar, tabs, and more. When it first launched in 2018, JupyterLab was great but felt it was missing some things.
Now you can add a visual debugger and there is even a library called nbdev that allows you to author full Python packages and push them to PyPI. JupyterLab has become a complete IDE for data scientists. But one thing was still sub-optimal until recently, code completions.
Trying to use the built-in code completion in JupyterLab gets you something like this:
Kite, a company that makes code completion software for a variety of languages and IDE’s, recently launched Kite for JupyterLab. Now you can get something like this:
Simplify your life with logical autocompletion. It runs locally and doesn’t send your code to the cloud.
It isn’t perfect, and it certainly doesn’t read your mind. It IS a good upgrade for the default code completion though.
Kite for JupyterLab brings you one step closer to a full notebook based IDE.
Installing Kite for JupyterLab is fairly painless.
- First, install Kite for Desktop. You can get the installer here. Versions are available for Windows, Mac, and Linux.
- Make sure your JupyterLab is version 2.2 or later. This is a pretty recent version of JupyterLab so you may need to upgrade with your install with conda or pip.
- Install the JupyterLab extension. You will need NodeJS installed just like for your other extensions.
pip install jupyter-kitejupyter labextension install "@kiteco/jupyterlab-kite"
I’ve only used Kite for JupyterLab for about a week now. It’s not groundbreaking, but it certainly makes my coding experience that much better. Completions are noticeably faster than the native completions as well.
I’m using the free version of Kite, and the completions take place 100% locally. The best suggestion for me isn’t always at the top, but it’s usually in the top 5. As data scientists, we use LOTS of methods, and this is a nice way to get reminders when needed.
Robert Ritz is a Data Scientist and educator based in Ulaanbaatar, Mongolia. He can be reached at [email protected]