Functions
src.utils.compression.compress_7z(path_in: Path, path_out: Optional[Path] = None, word_size: WordSize = WordSize.WS16, dict_size: DictionarySize = DictionarySize.DS1536) -> Path
Compress a target file and save it as a 7z archive to the output directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_in | Path | File to compress. | required |
path_out | Path | None | Path to the archive to be saved. Use 'compressed' subdirectory if not provided. | None |
word_size | WordSize | Word size value to use for the compression. | WS16 |
dict_size | DictionarySize | Dictionary size value to use for the compression. | DS1536 |
Returns:
Type | Description |
---|---|
Path | Path to the resulting 7z archive. |
Source code in src\utils\compression.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
src.utils.compression.compress_7z_all(path_in: Path, path_out: Path = None, word_size: WordSize = WordSize.WS16, dict_size: DictionarySize = DictionarySize.DS1536) -> None
Compress every file inside path_in
directory as 7z archives, then output those archives in the path_out
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_in | Path | Directory containing files to compress. | required |
path_out | Path | Directory to place the archives. Use a subdirectory 'compressed' if not provided. | None |
word_size | WordSize | Word size value to use for the compression. | WS16 |
dict_size | DictionarySize | Dictionary size value to use for the compression. | DS1536 |
Source code in src\utils\compression.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
src.utils.compression.unpack_zip(path: Path) -> None
Unpack target 'zip' archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | Path to the archive. | required |
Raises:
Type | Description |
---|---|
FileNotFoundError | If archive couldn't be located. |
Source code in src\utils\compression.py
152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
src.utils.compression.unpack_gz(path: Path) -> None
Unpack target 'gz' archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | Path to the archive. | required |
Raises:
Type | Description |
---|---|
FileNotFoundError | If archive couldn't be located. |
Source code in src\utils\compression.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
src.utils.compression.unpack_xz(path: Path) -> None
Unpack target 'xz' archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | Path to the archive. | required |
Raises:
Type | Description |
---|---|
FileNotFoundError | If archive couldn't be located. |
Source code in src\utils\compression.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
src.utils.compression.unpack_7z(path: Path) -> None
Unpack target '7z' archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | path to the archive. | required |
Raises:
Type | Description |
---|---|
FileNotFoundError | If archive couldn't be located. |
Source code in src\utils\compression.py
201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
src.utils.compression.unpack_tar_gz(path: Path) -> None
Unpack target tar.gz
archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | Path to the archive. | required |
Raises:
Type | Description |
---|---|
FileNotFoundError | If archive couldn't be located. |
Source code in src\utils\compression.py
216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
src.utils.compression.unpack_tar_xz(path: Path) -> None
Unpack target tar.xz
archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | Path to the archive. | required |
Raises:
Type | Description |
---|---|
FileNotFoundError | If archive couldn't be located. |
Source code in src\utils\compression.py
231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
src.utils.compression.unpack_archive(path: Path, remove: bool = True) -> None
Unpack an archive using the correct methodology based on its extension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | Path to the archive. | required |
remove | bool | Whether to remove the archive after unpacking. | True |
Raises:
Type | Description |
---|---|
FileNotFoundError | If archive couldn't be located. |
Source code in src\utils\compression.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
|