or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

environment-reporting.mdimport-tracking.mdindex.mdutilities.md
tile.json

tessl/pypi-scooby

A Python environment detective tool that reports package versions and hardware resources.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/scooby@0.10.x

To install, run

npx @tessl/cli install tessl/pypi-scooby@0.10.0

index.mddocs/

Scooby

Scooby 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.

Package Information

  • Package Name: scooby
  • Language: Python
  • Installation: pip install scooby
  • Python Requirement: >=3.8
  • Optional Extras: pip install scooby[cpu] (for psutil and mkl support)

Core Imports

import scooby

For 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_dependencies

Basic Usage

import 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}")

Architecture

Scooby is organized around three main reporting strategies:

  • Report: Manual specification of packages to include in environment reports
  • AutoReport: Automatic detection of package dependencies from distribution metadata
  • TrackedReport: Dynamic tracking of imports during a Python session

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.

Capabilities

Environment Reporting

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
    ): ...

Environment Reporting

Import Tracking

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
    ): ...

Import Tracking

Version and Environment Utilities

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]: ...

Utilities

Command Line Interface

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

Types

# 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'