Skip to main content

Plain Language Notebooks

Project description

Plainbook: Natural Language Notebooks

Plainbooks allow users to create and communicate data analysis and science using natural language.

Plainbooks are notebooks that combine instructions and results, similarly to Jupyter notebooks. The difference is that in Plainbook, users view natural language, rather than code. The code is generated "under the hood" using AI. This allows you to share your data analysis and science with a much wider audience, including people who do not know how to code, and to make it easier for everyone to understand what you are doing.

When you share a plainbook, recipients can use AI 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 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 the Plainbook project 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.

Installation and use

To install Plainbook, you might first want to create a Python environment:

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

You can install Plainbook with pip:

pip install plainbook

To open a plainbook (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.

AI API Keys. 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. The lead developer is spending only about $2/month on Gemini and Claude together, so the cost should be very low.

Examples

Resources

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, so that the results follow the same order in which we humans read the cells. Plainbooks 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 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

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.6.tar.gz (3.2 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.6-py3-none-any.whl (4.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plainbook-0.1.6.tar.gz
  • Upload date:
  • Size: 3.2 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.6.tar.gz
Algorithm Hash digest
SHA256 be9bb2bb18608217661cd5b9146feb11d5121c9ec3c402f18de52f9c975e3675
MD5 d3f4fabb4f92510ccb163058db9bebf4
BLAKE2b-256 9ba858ef2f973db51817c51c1fe4b04790ada3ddbc5a3e8e4a06708c71d16563

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plainbook-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 63f3a6e905beac42e99361d52a1354d56a1291f2ea069cb94d4d3f0bbe0d8acc
MD5 717d8d35a25bbea17f95a77a5f929824
BLAKE2b-256 30ed28cb1360bd44e7297e8b7ef61dc3b6ff5c372a4707313dd38c59b943f89a

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