A Python environment detective tool that reports package versions and hardware resources.
npx @tessl/cli install tessl/pypi-scooby@0.10.0Scooby is a Python environment detective tool that provides comprehensive environment reporting capabilities. It easily reports Python environment package versions and hardware resources, making it ideal for debugging, environment documentation, and issue reproduction.
pip install scoobypip install scooby[cpu] (for psutil and mkl support)import scoobyFor specific functionality:
from scooby import Report, AutoReport, TrackedReport
from scooby import get_version, track_imports, untrack_imports
from scooby import in_ipython, in_ipykernel, get_standard_lib_modules
from scooby import meets_version, version_tuple, doo
# Constants from scooby.report module
from scooby.report import MODULE_NOT_FOUND, MODULE_TROUBLE, VERSION_NOT_FOUND
from scooby.report import get_distribution_dependenciesimport scooby
# Generate a basic environment report
report = scooby.Report()
print(report)
# Generate a report with additional packages
report = scooby.Report(additional=['numpy', 'pandas', 'matplotlib'])
print(report)
# Generate an HTML report (for Jupyter notebooks)
report = scooby.Report()
report._repr_html_() # Returns HTML string
# Auto-generate report for a specific package and its dependencies
auto_report = scooby.AutoReport('numpy')
print(auto_report)
# Get version of a specific package
name, version = scooby.get_version('numpy')
print(f"{name}: {version}")Scooby is organized around three main reporting strategies:
The reporting system collects both system information (OS, CPU, RAM) and package versions through multiple detection mechanisms to handle various package installation and versioning patterns.
Create comprehensive environment reports showing system information, Python version, and package versions. Supports both plain text and HTML output formats for different environments.
class Report:
def __init__(
self,
additional=None,
core=None,
optional=None,
ncol=4,
text_width=80,
sort=False,
extra_meta=None,
max_width=None
): ...
class AutoReport(Report):
def __init__(
self,
module,
additional=None,
ncol=3,
text_width=80,
sort=False
): ...Track all imports during a Python session and generate reports based on the tracked packages. Useful for discovering actual package dependencies of a script or notebook.
def track_imports() -> None: ...
def untrack_imports() -> None: ...
class TrackedReport(Report):
def __init__(
self,
additional=None,
ncol=3,
text_width=80,
sort=False
): ...Utility functions for package version detection, version comparison, and environment detection capabilities.
def get_version(module) -> tuple[str, str | None]: ...
def meets_version(version: str, meets: str) -> bool: ...
def version_tuple(v: str) -> tuple[int, ...]: ...
def in_ipython() -> bool: ...
def in_ipykernel() -> bool: ...
def get_standard_lib_modules() -> set[str]: ...Scooby provides a command-line interface for generating environment reports from the terminal.
# Basic report with default optional packages
scooby
# Report with specific packages
scooby numpy pandas matplotlib
# Auto-generate report for a package and its dependencies
scooby --report numpy
scooby -r matplotlib
# Disable default optional packages
scooby --no-opt
# Sort packages alphabetically
scooby --sort
# Show version only
scooby --version
scooby -v
# Combine flags
scooby --report numpy --sort --no-opt# Type aliases for common parameter types
PackageSpec = str | ModuleType
PackageList = list[PackageSpec] | None
MetaInfo = tuple[tuple[str, str], ...] | list[tuple[str, str]] | None
# Aliases
doo = Report # Alternative name for Report class - allows scooby.doo()
# Constants
MODULE_NOT_FOUND = 'Module not found'
MODULE_TROUBLE = 'Trouble importing'
VERSION_NOT_FOUND = 'Version unknown'