{"id":5391,"library":"pyct","title":"pyct: Python Common Tasks","description":"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.","status":"active","version":"0.6.0","language":"en","source_language":"en","source_url":"https://github.com/holoviz-dev/pyct","tags":["utility","packaging","holoviz","commands","examples","data","dev-tools"],"install":[{"cmd":"pip install pyct","lang":"bash","label":"Core installation"},{"cmd":"pip install pyct[cmd]","lang":"bash","label":"With 'cmd' optional dependencies (e.g. progress bars)"}],"dependencies":[{"reason":"Core dependency for some utilities (e.g. get_setup_version), scheduled for removal in future versions.","package":"param","optional":false},{"reason":"Used for package metadata and utilities.","package":"setuptools","optional":false},{"reason":"Used for package metadata and utilities.","package":"packaging","optional":false},{"reason":"Required for the 'cmd' optional features, such as progress bars during data fetching.","package":"tqdm","optional":true}],"imports":[{"symbol":"pyct","correct":"import pyct"},{"symbol":"cmd","correct":"from pyct import cmd"},{"symbol":"build","correct":"from pyct import build"},{"note":"The function `add_pv_commands` was renamed to `add_commands` in pyct v0.4.4.","wrong":"from pyct.cmd import add_pv_commands","symbol":"add_pv_commands","correct":"from pyct.cmd import add_commands"}],"quickstart":{"code":"import pyct\nimport sys\nimport io\n\n# Redirect stdout to capture output for programmatic example\nold_stdout = sys.stdout\nredirected_output = io.StringIO()\nsys.stdout = redirected_output\n\ntry:\n    # Use pyct.report to print version information about specified packages\n    pyct.report(packages=['pyct', 'numpy', 'param'])\n    output = redirected_output.getvalue()\n    print(\"--- pyct.report output ---\")\n    print(output.strip())\n    print(\"--------------------------\")\nfinally:\n    sys.stdout = old_stdout # Restore stdout\n\nprint(\"You can also run 'pyct report' from the command line.\")","lang":"python","description":"This quickstart demonstrates how to use `pyct.report()` to display version information for the pyct library and other specified packages in the current environment."},"warnings":[{"fix":"Ensure your Python environment is version 3.8 or newer to use pyct 0.6.0+.","message":"pyct version 0.6.0 dropped support for Python versions older than 3.8. Earlier versions (0.5.0) also dropped support for Python 2.7 and 3.7.","severity":"breaking","affected_versions":"<0.6.0 (for <3.8), <0.5.0 (for <3.7/2.7)"},{"fix":"Avoid direct reliance on `get_setup_version`. Consult the `pyct` documentation or GitHub for recommended alternatives for version management or if you were using 'Param' through pyct.","message":"The `pyct.get_setup_version` function is deprecated and will be removed in a future version. The 'Param' dependency, which it relies on, will also be removed at the same time.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Update calls to `pyct.cmd.add_pv_commands()` to use `pyct.cmd.add_commands()` and adjust the arguments according to the new API specification.","message":"In pyct 0.4.4, the function `pyct.cmd.add_pv_commands()` was renamed to `add_commands()`, and its interface was modified.","severity":"breaking","affected_versions":"<0.4.4"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}