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.2.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.2-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plainbook-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7b87394f99e27ef148ff0583474aad586b4df3b8171b03b8e0e138e2f6812262
MD5 e53e49bf1400191b13fd7473257f7b89
BLAKE2b-256 2d63d1f3aea67f06fd5942e70e9e2a29ac160f28d13e809060693e0120bf43c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plainbook-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c41353a312875a3f43b16e523321c1fd123efb5d201b45787a4a4dd084f1258
MD5 43690b1e2421490355e0f090f1c04362
BLAKE2b-256 5815375d25d07ba3ca2d359a75bf7c71ea49299e4892b2b865e214af06cd18c6

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