Skip to main content

Jupyter kernel that can generate Python code from natural language prompts

Project description



Github Actions Status PyPI Latest Release Downloads Documentation Status License Discord Twitter

A Python library for soft-code development — program in plain English with AI code generation!


tl;dr in goes English, out comes Python:

https://user-images.githubusercontent.com/2453968/199964302-0dbe1d7d-81c9-4244-a9f2-9d959775e471.mp4

ICortex enables you to develop soft programs:

Soft program: a set of instructions (i.e. prompts) written in natural language (e.g. English), processed by a language model that generates code at a lower layer of abstraction (e.g. Python), to perform work more flexibly than regular software.

In other words, ICortex is a natural language programming (NLP) framework that enables you to write code in English, and then run it in Python. It aims to make programming more accessible to non-programmers.

ICortex is designed to be …

  • a drop-in replacement for the IPython kernel. Prompts are executed via magic commands such as %prompt.
  • interactive—automatically install missing packages, decide whether to execute the generated code or not, and so on, directly in the Jupyter Notebook cell.
  • open source and fully extensible—ICortex introduces a domain-specific language for orchestrating various code generation services. If you think we are missing a model or an API, you can request it by creating an issue, or implement it yourself by subclassing ServiceBase under icortex/services.

ICortex is similar to Github Copilot but with certain differences that make it stand out:

Feature GitHub Copilot ICortex
Generates code ... In the text editor At runtime through a Jupyter kernel
Control over code generation context ... No Yes
Natural language instructions are a ... Second-class citizen (Code comes first) First-class citizen (Prompts are the program)
The resulting program is ... Static Dynamic—adapts to the context
Can connect to different code generation APIs No Yes

The main difference between ICortex and a code-generation plugin like GitHub Copilot is that ICortex is a new paradigm for Natural Language Programming where the prompt is the first-class citizen. GitHub Copilot, on the other hand, enhances the existing paradigm that are already used by developers.

ICortex is currently in alpha, so expect breaking changes. We are giving free credits to our first users—join our Discord to request more if you finish the starter credits.

Installation

Locally

Install directly from PyPI:

pip install icortex
# This line is needed to install the kernel spec to Jupyter:
python -m icortex.kernel.install

On Google Colab

Google Colab is a restricted computing environment that does not allow installing new Jupyter kernels. However, you can still use ICortex by running the following code in a Colab notebook:

!pip install icortex
import icortex.init

Quickstart

Click here to visit the docs and get started using ICortex.

Getting help

Feel free to ask questions in our Discord.

Uninstalling

To uninstall, run

pip uninstall icortex

This removes the package, however, it may still leave the kernel spec in Jupyter's kernel directories, causing it to continue showing up in JupyterLab. If that is the case, run

jupyter kernelspec uninstall icortex -y

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icortex-0.1.2.tar.gz (101.4 kB view details)

Uploaded Source

Built Distribution

icortex-0.1.2-py3-none-any.whl (104.8 kB view details)

Uploaded Python 3

File details

Details for the file icortex-0.1.2.tar.gz.

File metadata

  • Download URL: icortex-0.1.2.tar.gz
  • Upload date:
  • Size: 101.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for icortex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 669edc3058a87aa0124741b4cab4ea8ddb2e1f62feea3416c7de049cda7b6553
MD5 ea37dd6411311e9559b5acf796910cfb
BLAKE2b-256 de26b768c52535b74643c751d82e9c4396c87f24d349cd822fa12616a14c5f56

See more details on using hashes here.

File details

Details for the file icortex-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: icortex-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 104.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for icortex-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df52df1a8596d504b14c6abbd4d8989f89c30f497aaac04f64bfa01d4d57d241
MD5 1f1958660abbd0726b8da844dbac7e22
BLAKE2b-256 01d2c9331e9631c6f11f3f29e15d8c01f17b98822558c2aaf6d6d6d9b67fe28e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page