Skip to main content

Plain Language Notebooks

Project description

Plainbook: Natural Language Notebooks.

Installation and use

To install Plainbook, you can use pip:

pip install plainbook

To run Plainbook, you might first want to create a Python environment, in case you need to install packages:

python -m venv plainbook-env
source plainbook-env/bin/activate  # On Windows, use `plainbook-env\Scripts\activate`

Then, you can run Plainbook on a notebook file (which will be created if it does not exist):

plainbook notebook.nlb

You can use any file name you like, with any extension you like.

Here is a plainbook on football matches to get you started: Download football.plb

You need a Gemini or Claude API key to use Plainbook. Click on the Settings button (the gear on the top right) and it will contain links where to get such keys.

Overview

The gloal of Plainbook is to allow users to create and communicate data analysis and science using natural language. Plainbooks are notebooks that combine instructions, with results, similarly to Jupyter notebooks. The difference is that in Plainbook, instructions are given in natural language, which is preserved in the notebook along with the results.

Users can create the notebooks using entirely natural language, which is translated into code by AI. Users can also include in the plainbooks tests, also written in natural language, that help check that the notebook is working as expected.

When sharing a plainbook, recipients can use AI, and in fact multiple AI providers if they so wish, to check that the "notebook does not lie", that is, that the code implementation is faithful to the natural language description, and they can also run the tests, as a further check. Recipients can also edit the natural language description, and regenerate the code, to adapt the notebook to their needs.

In other words, the goal of Plainbooks is to replicate in natural language what made Juptyter notebooks so successful: the ability to share together code and results, the ability to inspect how the results are obtained, and the ability to modify the notebook. The difference is that in Plainbook, these activities are done via natural language and AI, rather than via code, and are thus accessible to a much wider audience.

Plainbook Structure Plainbooks consist of three types of cells:

  • Action cells, where the user describes in natural language the action to be performed (e.g., "Load the dataset from file data.csv and display the first 10 rows"). The system converts the description to code, executes it, and displays the results below the cell.

  • Comment cells, where the user can add comments, section headers, and so forth, using markdown syntax.

  • Test cells, where the user can write properties that should hold at certain points of the notebook to check that everything is working as expected.

Differently from other notebook systems, Plainbooks are executed from start to end: random cell execution order, as in Jupyter notebooks, is not allowed. This ensures that the results are obtained in the same order in which a human reader would read the notebook.

AI Providers Plainbook is designed to work with multiple AI providers, and users can choose which provider to use for code generation and checking. The system is designed to allow users to easily switch between providers, so that users can cross-check that the implementation obtained from one provider is considered valid by another provider. This avoids over-reliance on a single class of AI models. Currently, Plainbook supports Gemini and Claude models. You will need an API key for at least one such provider to use Plainbook.

Contributors

  • Luca de Alfaro, lead developer, UC Santa Cruz.
  • Mathis Aubert, UC Santa Cruz.
  • Ranjit Jhala, UC San Diego.

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

plainbook-0.1.3.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plainbook-0.1.3-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file plainbook-0.1.3.tar.gz.

File metadata

  • Download URL: plainbook-0.1.3.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for plainbook-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7d6af578b717c3d9a14a9443f4b5ce00ac8e9a5a5710652cbf95c38699c9864b
MD5 3ca823d046f87951d1e46c780493590b
BLAKE2b-256 88abfa808ad2eb91b047f398b2e09816bd5408e79deec123126c8f494476429e

See more details on using hashes here.

File details

Details for the file plainbook-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: plainbook-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for plainbook-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6dbd5ea4f1f5e0792a436b125f5702c980fb809546ebef5e0ba8bd25d92f4e83
MD5 2aa274c8245c172f94edc1baea710f95
BLAKE2b-256 5485be84f14c8284003d799b2ef0eeb02a1fad5da3189a4b74568d75563b0c58

See more details on using hashes here.

Supported by

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