Archive
The external API class that encapsulates an archive implementation.
Attributes
| Attribute | Type | Description |
|---|---|---|
| _archive | object | The internal archive implementation instance used to perform file extraction, listing, and closing operations. |
Constructor
Signature
def Archive(
file: [Union](../../contrib/gis/db/models/functions/union.md?sid=django_contrib_gis_db_models_functions_union)[str, file-like object]
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| file | [Union](../../contrib/gis/db/models/functions/union.md?sid=django_contrib_gis_db_models_functions_union)[str, file-like object] | The path to the archive file or a file-like object representing the archive. |
Methods
extract()
@classmethod
def extract(
to_path: string
) - > null
Extracts the entire contents of the archive to the specified local directory path.
Parameters
| Name | Type | Description |
|---|---|---|
| to_path | string | The destination directory path where the archive contents will be extracted. |
Returns
| Type | Description |
|---|---|
null |
list()
@classmethod
def list() - > null
Lists the contents of the archive, typically printing or returning the metadata of the files contained within.
Returns
| Type | Description |
|---|---|
null |
close()
@classmethod
def close() - > null
Closes the underlying archive file handle and releases associated system resources.
Returns
| Type | Description |
|---|---|
null |