peal.web.ingest.safe_extract¶
- peal.web.ingest.safe_extract(zip_path, dest, max_files=20000, max_bytes=4294967296)[source]¶
Extract
zip_pathunderdestafter validating every member.All members are checked before anything is written: absolute paths,
..components, symlinks, more thanmax_filesfiles, a total uncompressed size abovemax_bytesand members with a suspicious compression ratio (BOMB_RATIOaboveBOMB_MIN_BYTES) are rejected.- Parameters:
- Returns:
Number of files written.
- Return type:
- Raises:
IngestError – If the archive is not a zip file or any check fails.