Scooby has HTML formatting for Jupyter notebooks and rich text formatting forjust about every other environment. We designed this module to be lightweightsuch that it could easily be added as a dependency to Python projects forenvironment reporting when debugging. Simply add scooby to your dependenciesand implement a function to have scooby report on the aspects of theenvironment you care most about.
The scooby reporting is derived from the versioning-scripts created by DieterWerthmller forempymod, emg3d, andthe SimPEG framework. It was heavily inspired byipynbtools.py from qutip andwatermark.py. This package has beenaltered to create a lightweight implementation so that it can easily be used asan environment reporting tool in any Python library with minimal impact.
Reports are rendered as html-tables in Jupyter notebooks as shown in thescreenshot above, and otherwise as plain text lists. If you do not output theReport object either at the end of a notebook cell or it is generatedsomewhere in a vanilla Python script, you may have to print the Reportobject: print(scooby.Report()), but note that this will only output the plaintext representation of the script.
Besides additional there are two more lists, core and optional, whichcan be used to provide package names. However, they are mostly useful forpackage maintainers wanting to use scooby to create their reporting system(see below).
The packages on the core-list are the mandatory ones for your project, whilethe optional-list can be used for optional packages. Keep theadditional-list free to allow your users to add packages to the list.
If you would like to implement scooby, but are hesitant to add anotherdependency to your package, here is an easy way how you can use scooby as asoft dependency. Instead of import scooby use the following snippet:
Scooby has the ability to track all imported modules during a Python sessionsuch that any imported, non-standard lib package that is used in the sessionis reported by a TrackedReport. For instance, start a session by importingscooby and enabling tracking with the track_imports() function.Then all subsequent packages that are imported during the session will betracked and scooby can report their versions.Once you are ready to generate a Report, instantiate a TrackedReport object.
in a terminal will display the default report. You can also use the CLI to showthe scooby Report of another package if that package has implemented a Reportclass as suggested above, using packagename.Report().
The CLI can also generate a report based on the dependencies of a package'sdistribution where that package hasn't implemented a Report class. For example,we can generate a Report for matplotlib and its dependencies:
59fb9ae87f