pyct: Python Common Tasks

0.6.0 · active · verified Mon Apr 13

pyct (Python Common Tasks) is a utility package from the HoloViz ecosystem designed to simplify common tasks for Python projects, such as copying examples, fetching data, and reporting environment details. It also provides utilities for package building, primarily as a convenience for project maintainers. The current version is 0.6.0. It maintains an active development pace with regular releases addressing Python compatibility, introducing new utilities, and deprecating older patterns.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `pyct.report()` to display version information for the pyct library and other specified packages in the current environment.

import pyct
import sys
import io

# Redirect stdout to capture output for programmatic example
old_stdout = sys.stdout
redirected_output = io.StringIO()
sys.stdout = redirected_output

try:
    # Use pyct.report to print version information about specified packages
    pyct.report(packages=['pyct', 'numpy', 'param'])
    output = redirected_output.getvalue()
    print("--- pyct.report output ---")
    print(output.strip())
    print("--------------------------")
finally:
    sys.stdout = old_stdout # Restore stdout

print("You can also run 'pyct report' from the command line.")

view raw JSON →