nbproject.header

nbproject.header(*, parent=None, pypackage=None, filepath=None, env=None, metadata_only=False)

Display metadata and start tracking dependencies.

If the notebook has no nbproject metadata, initializes & writes metadata to disk.

Parameters:
  • parent (str | List[str] | None, default: None) – One or more nbproject ids of direct ancestors in a notebook pipeline.

  • pypackage (str | List[str] | None, default: None) – One or more python packages to track.

  • filepath (str | None, default: None) – Filepath of notebook. Only needed if automatic inference fails.

  • env (str | None, default: None) – Editor environment. Only needed if automatic inference fails. Pass 'lab' for jupyter lab and 'notebook' for jupyter notebook, this can help to identify the correct mechanism for interactivity when automatic inference fails.

  • metadata_only (bool, default: False) – Whether or not to return only metadata without writing or displaying anything.

Return type:

Tuple[Mapping, bool, Notebook] | None