Quickstart

  1. header() provides relevant context.

  2. publish() prepares a notebook for sharing it with someone else.

from nbproject import header, publish, meta

header(parent=["z14KWQKD4bwE", "jhvyoIrxoeSz"])  # Initializes & displays metadata.
id3m2Q6UBuwgSH
version0
time_init2022-07-18 12:32
time_run2024-10-16 16:56
parentz14KWQKD4bwE jhvyoIrxoeSz
pypackagenbproject==0.10.5 pandas==2.2.3

Note

  • Passing parent to header() is optional. You can use it to point viewers to upstream notebooks or to build pipelines.

  • You can also pass pypackage to header() to track secondary dependencies.

import pandas  # Any imported package is automatically tracked.

Once you’re happy with the present version of your notebook:

publish()  # Sets version, checks consecutiveness & title, writes current pypackages with versions.
✓ cell execution numbers increase consecutively
• Set notebook version to 0 & wrote pypackages.

Note

If you’re a developer and want to build on top of nbproject, the API offers: