API

session_info2.session_info(*, os=True, cpu=False, gpu=False, dependencies=None)

Display versions of imported packages and the system.

Parameters:
  • os (bool, default: True) – Include OS name and version.

  • cpu (bool, default: False) – Include number of CPU cores.

  • gpu (bool, default: False) – Include information per supported GPU.

  • dependencies (bool | None, default: None) – Print versions of dependencies.

Return type:

SessionInfo

Returns:

Collected information about the session.

class session_info2.SessionInfo(pkg2dists, user_globals, dependencies=None, info=<factory>)

Information about imported packages.

Can be displayed as string (__repr__()), Markdown/HTML (_repr_mimebundle_()), or as a widget()).

__repr__()

Generate string representation.

Return type:

str

_repr_mimebundle_(include=None, exclude=None, **_kwargs)

Generate MIME bundle representations.

Parameters:
Return type:

dict[Literal['text/plain', 'text/markdown', 'text/html', 'application/json', 'application/vnd.jupyter.widget-view+json'], Any]

dependencies: bool | None = None

Whether to include versions of dependencies. (None means that behavior depends on the individual representation.)

property deps_dists: Set[str]

Ordered set of loaded distributions that aren’t imported.

property dist2pkgs: Mapping[str, frozenset[str]]

Mapping of distributions to packages.

property imported_dists: Set[str]

Ordered set of imported distributions.

pkg2dists: Mapping[str, Sequence[str]]

Mapping of package names to distributions.

user_globals: Mapping[str, Any]

Mapping of variable names to objects.

widget()

Generate interactive HTML representation.

Return type:

Widget