src.geometor.euclid.ingest.organization¶
Module for organizing extracted files into a structured directory hierarchy.
Functions¶
|
Ensures a directory exists. |
|
Returns the maximum page number from a list of page dictionaries. |
|
Recursive function to assign page ranges to paths. |
|
Organizes extracted content into folders based on page assignments. |
Module Contents¶
- src.geometor.euclid.ingest.organization.ensure_dir(path: pathlib.Path) None¶
Ensures a directory exists.
- src.geometor.euclid.ingest.organization.get_max_page(pages: List[Dict[str, Any]]) int¶
Returns the maximum page number from a list of page dictionaries.
- src.geometor.euclid.ingest.organization.assign_ranges(toc_entries: List[Dict[str, Any]], start_page: int, end_page: int, parent_path: pathlib.Path, assignments: Dict[int, pathlib.Path]) None¶
Recursive function to assign page ranges to paths.
- Parameters:
toc_entries – The table of contents entries.
start_page – The starting page number.
end_page – The ending page number (exclusive).
parent_path – The parent path for the current entry.
assignments – Dictionary mapping page_num -> path to be updated.
- src.geometor.euclid.ingest.organization.run_organization() None¶
Organizes extracted content into folders based on page assignments.