Announcing the Kite Integration for Spyder
Tags: python, devtips, datascience, startup
Published: 2019-12-10 00:26:12

---
title: Announcing the Kite Integration for Spyder
published: true
description: Kite code completions are now available in Spyder 4. Spyder users can use Kite’s machine learning models to get more and better completions while coding with numerics libraries. 
tags: python, devtips, datascience, startup
cover_image: https://thepracticaldev.s3.amazonaws.com/i/1mmmsa6sahnbxyw9nufb.png
---

We’re thrilled to announce Kite’s Python integration for [Spyder](https://www.spyder-ide.org/), the popular open-source IDE for scientists, engineers, and data analysts. Kite is now available as a free Python code completions option for all Spyder users as part of the [Spyder 4 release](https://github.com/spyder-ide/spyder/releases).

Spyder users can use Kite’s machine learning models to get more and better completions while coding with [PyData](https://www.scipy.org/) libraries (e.g. NumPy, SciPy, Pandas, and Matplotlib). These libraries previously had minimal autocomplete support due to type analysis limitations of the completions engine Spyder used to exclusively rely on, called Jedi.

Kite worked alongside Spyder’s core contributors to incorporate several autocomplete improvements in the Spyder 4 release. This collaboration happened through Quansight’s [Community Work Order program](https://labs.quansight.org/blog/2019/05/community-driven-opensource-funded-development/), a new framework for private companies to partner with open source projects.

## TL;DR
  * Kite can be selected as a free code completions option in Spyder 4. Download and install Spyder 4 via [Anaconda](https://www.anaconda.com/download/) or via [Spyder’s Github repo](https://github.com/spyder-ide/spyder/releases).
  * Spyder users will see autocomplete improvements when enabling Kite, including faster and more useful completions for numerics libraries. Watch an overview video about Kite for Spyder on our [YouTube channel](https://youtu.be/yYMCAhKt2pg).
  * Kite’s [Intelligent Snippets](https://kite.com/blog/product/announcing-intelligent-snippets-for-python/), [Line-of-Code Completions](https://kite.com/blog/product/launching-line-of-code-completions-going-cloudless-and-17-million-in-funding/), Dictionary Key Completions, and [Copilot](https://kite.com/copilot/) desktop app are all supported for Spyder users. 
  * As with Kite’s other editor integrations, all code processing happens locally without leaving the user’s computer.
  * Kite and the Spyder core contributors worked together on this integration via Quansight’s [Community Work Order program](https://labs.quansight.org/blog/2019/05/community-driven-opensource-funded-development/).
  * You'll need to have Kite installed on your computer to enable our Spyder integration. Download Kite [here](kite.com/download).

## Getting more completions, more often for numerics libraries in Spyder
Spyder users have [long reported](https://github.com/spyder-ide/spyder/issues/5782) issues with the completions for numerics libraries. This was largely due to type analysis limitations in the Jedi completions engine. It had difficulty analyzing third-party libraries for scientific computing (e.g. NumPy, SciPy, TensorFlow, etc.) that make use of compiled extensions. Without good type analysis, generating completions is inaccurate and resource intensive.

Enabling Kite in Spyder solves this problem, and goes beyond in a number of ways. Kite’s ML engine generates multi-token completions, and returns completions much faster.

To enable Kite in Spyder, go to Preferences/ Settings -> click on Completion and Linting -> click on the “Advanced” tab -> click “Enable Kite” under Providers -> click “Apply”.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/zksll8s60fy1wriu2gso.png)

## Kite’s smarter completions features
Kite also features Line-of-Code Completions, Intelligent Snippets, and recently released, Dictionary Key Completions – all of which save you time and hassle while coding.

Line-of-Code Completions are multi-token completions for the top 100 Python libraries that are unique to Kite’s machine learning engine. 
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/0jhaozll7h46ymvxq498.gif)

Intelligent Snippets allow you to complete complex, multi-token statements with ease by generating context-relevant code snippets as you type. Whereas editor snippets typically must be manually defined in advance, Kite’s Intelligent Snippets are generated in real-time based on the code patterns Kite finds in your codebase.

Dictionary Key Completions save you time by remembering the structure of dictionary objects in your codebase. These completions work for integer keys as well as string keys, the latter of which can be tedious to recall and prone to typos. Check out examples and a more detailed description of this new feature in our December release notes.

## Improving completions performance in Spyder
Enabling Kite results in faster completions in Spyder for two main reasons. First, the Spyder and Kite teams worked together to make performance optimizations to reduce completions lag for Spyder 4. Second, Kite’s ML engine is continually optimized to show smarter completions, faster.

At Kite we invest in routine optimization of application and ML model performance to limit impact on users’ CPU and memory resources. For instance, Kite intelligently caches index builds based on whether your Python files have changed recently. It also only loads parts of its ML engine based on whether relevant libraries are used in users’ codebases. So if you’re only using numerics libraries, only relevant parts of the Kite engine will be running to conserve resources.

## Did we mention one-click docs search?
Another nice perk of enabling Kite is access to Kite’s Copilot app and one-click docs search within Spyder. Check out the Kite Copilot [here](https://kite.com/copilot/) for more information.

## Leveraging Quansight’s Community Work Order
Quansight’s [Community Work Order (CWO)](https://labs.quansight.org/blog/2019/05/community-driven-opensource-funded-development/) was an ideal framework to collaborate with the Spyder core contributors on improving the completions experience, a feature which had been the center of a lot of [user feedback](https://github.com/spyder-ide/spyder/issues/5782). 

Given all of the resources we’ve invested into completions intelligence at Kite, we saw a natural fit to work with the Spyder team to improve Spyder’s completions infrastructure and get AI-powered completions in the hands of more developers for free.

However, structuring projects between open source communities and private companies is challenging across a number of dimensions: What work should be done? Who does the work? How long will it take? Where does the funding come from and what is it spent on? Quansight’s CWO provided transparency for how to fund and structure a partnership of this nature. [Read more about the principles of CWOs on Quansight’s blog.](https://labs.quansight.org/blog/2019/05/community-driven-opensource-funded-development/)

The CWO we sponsored provided funds for the development hours needed to improve the completions experience for Spyder 4. Additionally, Kite engineers and product managers contributed hours towards [performance improvements](https://github.com/spyder-ide/spyder/pull/10502) and debugging efforts within the Spyder codebase.

We enjoyed contributing to the Spyder 4 release, and we look forward to collaborating on ongoing efforts with the Spyder community to support free completions!

Share the news on Twitter with @Spyder_IDE and @KiteHQ. Download Kite [here](kite.com/download).