Scooby
Scooby is a lightweight Python library designed to report on your Python environment's package versions and hardware resources. It generates nicely formatted reports (HTML for Jupyter notebooks, plain text otherwise) to aid in debugging and reproducibility. Currently at version 0.11.0, it is actively maintained with a consistent release cadence.
Warnings
- breaking As of v0.8.0, Scooby primarily uses `importlib.metadata` (standard in Python 3.8+) for retrieving package versions, replacing `pkg_resources`. While fallbacks may exist, applications relying on `scooby` for versioning, especially in older Python environments or with unusual package distributions, should verify compatibility.
- gotcha When integrating Scooby as a 'soft dependency' within another package, directly importing `scooby` might raise an `ImportError` if it's not installed. It's recommended to wrap the import in a `try-except ImportError` block.
- gotcha In vanilla Python scripts (outside of Jupyter/IPython environments), simply calling `scooby.Report()` will not display the report. The `Report` object must be explicitly printed to show its plain-text representation.
- gotcha By default, `scooby.Report()` includes `numpy`, `scipy`, `IPython`, and `matplotlib` (and `scooby` itself) in its 'optional' package list if found. If these packages are crucial 'core' dependencies for the project being reported, they should be explicitly passed to the `core` argument of `scooby.Report()` for clear distinction.
Install
-
pip install scooby -
conda install -c conda-forge scooby
Imports
- Report
from scooby import Report
- doo
from scooby import doo
- AutoReport
from scooby import AutoReport
- track_imports
from scooby import track_imports
- get_version
from scooby import get_version
Quickstart
import scooby # Generate and print a basic environment report report = scooby.Report() print(report) # You can also use the 'doo' alias for fun # print(scooby.doo()) # To report on specific packages (e.g., numpy, matplotlib) and define core/optional # my_report = scooby.Report(additional=['numpy', 'matplotlib'], core=['my_package'], optional=['another_package']) # print(my_report)