get_archived_path#
- get_archived_path(archive_path: str | CloudPath | Path, file_regex: str, as_list: bool = False) list | CloudPath | Path [source]#
Deprecated since version 1.30.0: Import it from
sertit.path
instead ofsertit.files
Get archived file path from inside the archive.
Warning
If
as_list
isFalse
, it will only return the first file matched !You can use this site to build your regex.
Example
>>> arch_path = 'D:/path/to/zip.zip' >>> file_regex = '.*dir.*file_name' # Use .* for any character >>> path = get_archived_path(arch_path, file_regex) 'dir/filename.tif'
- Parameters:
- Returns:
Path from inside the zipfile
- Return type: