nbproject.dev.infer_pypackages#

nbproject.dev.infer_pypackages(content, add_pkgs=None, pin_versions=True)#

Parse notebook object and infer all pypackages.

This does not account for additional packages in file metadata.

For the user-facing functionality, see pypackage().

Parameters
  • nb – A notebook to infer pypackages from.

  • add_pkgs – Additional packages to add.

  • pin_versions – If True, fixes versions from the current environment.

Examples

>>> pypackages = nbproject.dev.infer_pypackages(nb)
>>> pypackages
{"scanpy": "1.8.7", "pandas": "1.4.3"}