coco_pipe.report.provenance¶
Utilities for capturing reproducibility metadata (Git hash, environment, versions).
Functions¶
|
Return the current git hash if available. |
|
Safely get package version. |
|
Capture runtime environment information for reproducibility. |
Module Contents¶
- coco_pipe.report.provenance.get_git_revision_hash() str[source]¶
Return the current git hash if available.
- Returns:
Short git hash (e.g. “a1b2c3d”) or “Unknown”.
- Return type:
str
- coco_pipe.report.provenance.get_package_version(package_name: str) str[source]¶
Safely get package version.
- Parameters:
package_name (str) – Name of the pip package.
- Returns:
Version string or “Unknown”.
- Return type:
str
- coco_pipe.report.provenance.get_environment_info() Dict[str, Any][source]¶
Capture runtime environment information for reproducibility.
- Returns:
Dictionary containing timestamp, os, python version, git hash, etc.
- Return type:
Dict[str, Any]
Examples
>>> info = get_environment_info() >>> print(info['git_hash']) 'a1b2c3d'