ospx.utils.zip

Functions

add_file_content_to_zip(zip_file, file_name, ...)

Add a single file and its ascii content.

read_file_content_from_zip(zip_file, file_name)

Read a single file.

remove_files_from_zip(zip_file, *file_names)

Remove files.

rename_file_in_zip(zip_file, file_name, ...)

Rename files.

substitute_text_in_zip(zip_file[, ...])

Substitute a given string in all files matching the passed file name pattern.

update_file_content_in_zip(zip_file, ...)

Update the ascii content of a single file.

ospx.utils.zip.add_file_content_to_zip(zip_file: Path, file_name: str, file_content: str) ZipFile | None

Add a single file and its ascii content.

Belongs to zip functions.

ospx.utils.zip.read_file_content_from_zip(zip_file: Path, file_name: str) str | None

Read a single file.

Belongs to zip functions

ospx.utils.zip.remove_files_from_zip(zip_file: Path, *file_names: str) ZipFile | None

Remove files.

Belongs to zip functions.

ospx.utils.zip.rename_file_in_zip(zip_file: Path, file_name: str, new_file_name: str) ZipFile | None

Rename files.

Belongs to zip functions.

ospx.utils.zip.substitute_text_in_zip(zip_file: Path, file_name_pattern: str = '', subst: tuple[str, str] = ('', '')) ZipFile | None

Substitute a given string in all files matching the passed file name pattern.

Belongs to zip functions.

ospx.utils.zip.update_file_content_in_zip(zip_file: Path, file_name: str, file_content: str) ZipFile | None

Update the ascii content of a single file.

Belongs to zip functions.