plainbook

Plainbook: Natural Language Notebooks

Plainbooks are computational notebooks written in natural language, so anyone can read and modify them, without requiring coding knowledge.

Plainbooks aim at replicating what made Jupyter notebooks successful, namely the ability to create and share reproducible data analysis, while broadening their audience beyond people familiar with coding.

The main features of Plainbook are:

You can read more about the design philosophy of Plainbook, and its code testing approach, in the paper Plainbook: Data Science, in Plain Language.

Try Plainbook Now

Videos

Run on GitHub Codespaces (no installation needed):

  1. Click Code → Codespaces in the GitHub interface
  2. Wait ~3 minutes for the environment to set up
  3. Click Open in Browser for port 8080; the Soccer World Cup example is already open
  4. A trial Claude API key is provided; you can add your own in Settings

Example Notebooks

A plainbook analyzing soccer World Cup data, showing plain-language cells next to the code generated from them

🔍 Click the image to enlarge it

To try one, save the file, then open it with Plainbook:

plainbook Soccer_w_Tests.plnb

Installation and use

You can install Plainbook with pip:

pip install plainbook

To open a plainbook (which will be created if it does not exist):

plainbook notebook.plnb

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

Installing Plainbook gives you the notebook environment, but not the data-science packages themselves: pandas, matplotlib and the like are not pulled in. You do not need to install them in advance, though. When a cell’s generated code imports a package that is not present, Plainbook says so and offers to install it for you, or to rewrite the code without it.

Plainbook Structure

Plainbooks consist of three types of cells:

Working with Notebooks

Alongside the cells, three notebook-wide tools are available from the navbar and from the panel above the first cell.

Accessing files: You can use the Files panel allows you to select the data files that will be used in the notebook.

Verification: You can verify that the whole notebook is safe to run, and you can verify that each cell works as intended:

AI Instructions: The Instructions panel holds guidance that is appended to every code-generation request in that notebook — for example, “always label the axes of plots”, or “prefer polars over pandas”.

Linear Execution: Unlike standard Jupyter notebooks (and like Marimo), Plainbook cells are guaranteed to be executed in order, from first to last, matching the order in which humans read the cells. Plainbook relies on a checkpointing kernel to remember the execution state after each cell, so that it can re-run a cell without having to start from the beginning.

AI Models

Plainbook needs an AI model to generate and validate code. You can use:

You can easily switch between the models in the AI model dropdown in the navbar.

If you choose to use a local model, Plainbook downloads the Ollama runtime into ~/.config/plainbook/ollama/ (no administrator rights needed; about 160 MB on macOS, 1.4 GB on Linux and Windows, or it uses an Ollama you already have) and then the model, gpt-oss:20b (about 14 GB, kept in Ollama’s usual ~/.ollama/models). The model needs a computer with at least 16 GB of memory. Once set up, choose Local: GPT-OSS 20B from the AI model dropdown in the navbar. The model is loaded when you select it and unloaded when you switch to a cloud model or close Plainbook. Local models are slower and less capable than the cloud ones, but they are a way to try Plainbook, and to work privately, at no cost. Remove in Settings deletes the model from your disk.

Papers

To cite Plainbook, you can cite the software, or the paper.

Resources

Contributors

To contribute to Plainbook, please see CONTRIBUTING.md for the licensing terms, and DEVELOP.md for development setup.

License

Plainbook is released under the BSD 3-Clause license. Contributions are accepted under the same license — see CONTRIBUTING.md.