Skip to main content

Plain Language Notebooks

Project description

Plainbook: Natural Language Notebooks.

Authors:

Luca de Alfaro, dealfaro@acm.org

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 path/to/notebook.nlb

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: plainbook-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 9ffa224a04ca703b1b74a9985b6eb2a45022348d37b32d420bb53306ef978d1d
MD5 f7be871d4f88ed8ebabd9acd72f69227
BLAKE2b-256 8488f0138e7ad563b6ee13eae5aafb8528ded41cadcda1a21f30d1883aa1c8f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plainbook-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9c6250b9d6b94fa8d0417f92a7e980f41255b308b26e90c4835663bde38ea19
MD5 a3d49d57b08fed6b3de457e90f9e9ac0
BLAKE2b-256 f89f06bf858e5f4313ebf456e781eb3fadbe8df31c7252651caf61f85b24565f

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