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
versiondraft
time_init2022-07-18 12:32
time_run2022-10-07 21:44
parentz14KWQKD4bwE jhvyoIrxoeSz
pypackagenbproject==0.5.3 pandas==1.5.0

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 numbers increase consecutively: Awesome!
ℹ️ Set notebook version to 1 & wrote pypackages.

Note

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