(search_dir: Path, depth: int = 0)
| 120 | found_files = {} |
| 121 | |
| 122 | def search_recursive(search_dir: Path, depth: int = 0): |
| 123 | if depth > 5: |
| 124 | return |
| 125 | |
| 126 | for item in search_dir.iterdir(): |
| 127 | if item.is_file() and item.suffix.lower() in ['.csv', '.xlsx']: |
| 128 | if item.name in filenames: |
| 129 | found_files[item.name] = item |
| 130 | elif item.is_dir() and not item.name.startswith('.'): |
| 131 | search_recursive(item, depth + 1) |
| 132 | |
| 133 | search_recursive(directory) |
| 134 | return found_files |