bundle.core.utils¶
Attributes¶
Functions¶
|
Ensures existence of a path's directories. For file paths, creates missing parent directories. |
|
Formats a duration in nanoseconds to a human-readable string. |
|
Converts a timestamp in nanoseconds to a formatted UTC date string. |
Module Contents¶
- bundle.core.utils.logger¶
- bundle.core.utils.ensure_path(path: pathlib.Path | str) pathlib.Path[source]¶
Ensures existence of a path’s directories. For file paths, creates missing parent directories. For directory paths, creates the directory if missing. Logs creation actions.
- Parameters:
path (Path) – Target file or directory path.
- Returns:
Verified path
- Return type:
Path
- bundle.core.utils.format_duration_ns(ns: int) str[source]¶
Formats a duration in nanoseconds to a human-readable string.
Converts nanoseconds to days, hours, minutes, seconds, milliseconds, and microseconds, displaying only the non-zero units.