util
util
Utility helpers for the syncweaver package.
Functions
| format_subprocess_error |
Format subprocess failures with captured stdout and stderr. |
| get_version |
Return the installed package version. |
| print_citation |
Print the project citation and exit when the citation flag is enabled. |
| repo_base |
Return an absolute path rooted at the syncweaver package directory. |
get_version
Return the installed package version.
Reads from the VERSION file bundled with the package, falling back to importlib.metadata if unavailable.
print_citation
util.print_citation(context, param, value)
Print the project citation and exit when the citation flag is enabled.
Parameters
| context |
|
Click context. |
required |
| param |
|
Click option parameter (unused callback argument). |
required |
| value |
|
Citation flag value. |
required |
Returns
| None |
None |
Always returns None. |
Examples
>>> # Used as a Click callback and not called directly.
repo_base
Return an absolute path rooted at the syncweaver package directory.
Parameters
| *paths |
str |
Additional path segments to join. |
() |
Returns
|
pathlib.Path |
pathlib.Path: Resolved path. |
Examples
>>> repo_base("CITATION.cff")