Description:
- Interact with data in s3
Resources:
Environment variables
Section titled “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 cell downloads ganymede-demo/example.zip from that bucket; upload any zip archive there first.
Example 1
Section titled “Example 1”Download a file from a remote path on s3 to local filesystem
import os
from fsspec import filesystemfrom pathlib import Path
tmp = "/tmp/ganymede_demo"Path(tmp).mkdir(parents=True, exist_ok=True)
s3 = filesystem("s3")
local_zip_fp = f"{tmp}/example.zip"s3.get(rpath=f"s3://{os.environ['S3_BUCKET']}/ganymede-demo/example.zip", lpath=local_zip_fp)ganymede is made by Eugo