skillfed

session-info2

Print versions of imported packages.

session-info2 v0.4.2 1.1M downloads/30d#4,433 on PyPI9
Copyleft license MPL-2.0 Active released

What it is and what it does

session-info2 is a utility for capturing and printing the versions of all packages imported in your Python environment. It works both as a command-line tool and as a library you can call from scripts or notebooks. The core use case is documenting your environment's dependency state for reproducibility—particularly useful in Jupyter notebooks where you want to record what versions were active when you ran an analysis.

The package has no runtime dependencies and works by introspecting the imported modules in your current session. You can call it with options to include or exclude OS info, list indirect dependencies, or format the output in different ways. It supports Python 3.12 and later, including PyPy, and is actively maintained.

Use it for:

  • Document the exact package versions used in a Jupyter notebook for reproducibility and sharing.
  • Generate a dependency snapshot at the start of a script to include in logs or reports.
  • Verify that a specific package version is loaded in your current session before running code.
  • Compare environment states across different machines or CI/CD runs by capturing session info at key points.
  • Include environment metadata in bug reports or issue discussions to help others reproduce problems.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Captures and displays the versions of all imported packages in your Python environment, useful for documenting reproducible setups in notebooks and scripts.

Yes. Low install friction, no dependencies, active maintenance, and no known vulnerabilities. The copyleft license (MPL-2.0) is permissive for use and modification. Useful for anyone working in notebooks or scripts who needs to track or document their environment state.

Install

session-info2 on PyPI

pip

pip install session-info2

uv

uv add session-info2

poetry

poetry add session-info2

Installing session-info2

Before you install

Low friction: pure Python wheel with no runtime dependencies. Active maintenance with last commit 2026-08-11. Requires Python 3.12 or later.

License in practice

Licensed under MPL-2.0 (copyleft). You may use and modify the package freely, but any modifications must be released under the same license if distributed.

Quickstart

pip install session-info2

from session_info2 import session_info

session_info()

Requires Python 3.12 or later.

Verify before relying

  • Whether the CLI tool (`session-info` command) works identically to the programmatic API or has different output modes.
  • How the package handles packages installed in editable mode or from non-standard sources.
  • Performance characteristics when run on environments with hundreds of installed packages.

Package facts

License MPL-2.0 (copyleft)
Python support supports the current Python release (>=3.12)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 10 days since the last release
Last repo commit
First released
Downloads 1,055,275/month — #4,433 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: session_info2-0.4.2-py3-none-any.whl

Keywords: jupyter, session-info

Development Status :: 4 - BetaProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTyping :: Typed

Tags

package version reportingsession info jupyterenvironment reproducibilitydependency version trackingpython package versionsnotebook environment snapshotinstalled package list
reproducibilityjupyter-friendlyenvironment-inspection

More Utilities packages