ontocast.util.files¶
crawl_directories(input_path, suffixes=('.pdf', '.json'), prefix=None)
¶
Collect input files from a directory tree, or accept a single file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_path
|
Path
|
A file to use directly, or a directory to search recursively. |
required |
suffixes
|
tuple[str, ...]
|
Accepted file extensions. |
('.pdf', '.json')
|
prefix
|
str | None
|
When given, keep only files whose stem starts with it. |
None
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
Matching paths; empty when a directory holds none. Suffixes match |
list[Path]
|
case-insensitively ( |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |