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.
time_init2022-07-18 12:32
time_run2023-03-12 18:00
parentz14KWQKD4bwE jhvyoIrxoeSz
pypackagenbproject==0.8.3 pandas==1.5.3


  • 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 0 & wrote pypackages.


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