Constructs an EvidenceDescriptor from a file or directory path, resolving segment groups and hash targets for forensic evidence cataloging.
def descriptor_for_path(
path: str | Path,
*,
source_path: str | Path | None = None,
source_mode: str = "path",
label: str | None = None,
files_to_hash: list[str | Path] | tuple[str | Path, ...] | None = None,
extracted_from: str | Path | None = None,
extraction_root: str | Path | None = None,
primary_dissect_path: str | Path | None = None,
) -> EvidenceDescriptor:
"""Build an evidence descriptor for a direct file or directory path."""
target_path = Path(primary_dissect_path) if primary_dissect_path is not None else Path(path)
source = Path(source_path) if source_path is not None else Path(path)
if files_to_hash is None:
if source.is_file() and segment_identity(source) is not None:
group_paths = collect_segment_group_
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key