> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# Zipp

> Zipp: A pathlib-compatible Zipfile object wrapper. A Python demo notebook from ganymede.

Web page: https://eugo.io/docs/ganymede/demo_notebooks/data_storage/filesystems/zipp/
Notebook: https://eugo.io/docs/ganymede/demo_notebooks/data_storage/filesystems/zipp/zipp.ipynb (source: https://github.com/eugo-inc/ganymede/blob/main/demo_notebooks/data_storage/filesystems/zipp.ipynb)

Description:
- A pathlib-compatible Zipfile object wrapper

Resources:
- https://github.com/jaraco/zipp
- https://zipp.readthedocs.io/en/latest/

## Environment variables

This notebook reads its settings from environment variables. Set them before starting Jupyter:

- `S3_BUCKET`: name of an S3 bucket you can access

The cells read `ganymede-demo/example.zip` from that bucket; upload any zip archive there first.

```python
from fsspec import filesystem
from zipp import Path
from zipfile import ZipFile
```

```python
import os

from fsspec import filesystem

# Get the remote archive object and download locally
libarchive_fs = filesystem("libarchive", fo=f"s3://{os.environ['S3_BUCKET']}/ganymede-demo/example.zip")
libarchive_fs.ls("", detail=False)
libarchive_fs.info("")
```

```python
import os

s3 = filesystem("s3")

tmp = "/tmp/ganymede_demo"
os.makedirs(tmp, exist_ok=True)

local_fp = f"{tmp}/example.zip"
s3.get(rpath=f"s3://{os.environ['S3_BUCKET']}/ganymede-demo/example.zip", lpath=local_fp)
```

```python
from zipp import Path

p = Path(local_fp)
p.stem
```
