Storage client for Tilebox
Project description
Tilebox Storage
Download satellite payload data for your Tilebox datasets.
Quickstart
Install using pip
:
pip install tilebox-storage tilebox-datasets
Fetch a datapoint to download the payload data for:
from tilebox.datasets import Client
# Creating clients
client = Client(token="YOUR_TILEBOX_API_KEY")
datasets = client.datasets()
# Choosing the dataset and collection
s2_dataset = datasets.open_data.copernicus.sentinel2_msi
collections = s2_dataset.collections()
collection = collections["S2A_S2MSI2A"]
# Loading metadata
s2_data = collection.load(("2024-08-01", "2024-08-02"), show_progress=True)
# Let's download the first granule
s2_granule = s2_data.isel(time=0)
Then download the payload data using a storage client:
from pathlib import Path
from tilebox.storage import CopernicusStorageClient
# Check out the Copernicus Dataspace S3 documentation at
# https://documentation.dataspace.copernicus.eu/APIs/S3.html
# to learn how to get your access key and secret access key
storage_client = CopernicusStorageClient(
access_key="YOUR_ACCESS_KEY",
secret_access_key="YOUR_SECRET_ACCESS_KEY",
cache_directory=Path("./data")
)
downloaded_data = storage_client.download(s2_granule)
print(f"Downloaded granule: {downloaded_data.name} to {downloaded_data}")
print("Contents: ")
for content in downloaded_data.iterdir():
print(f" - {content.relative_to(downloaded_data)}")
License
Distributed under the MIT License (The MIT License
).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tilebox_storage-0.28.0.tar.gz
.
File metadata
- Download URL: tilebox_storage-0.28.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb6a26704609d828f1fa83795f47ce30a5e28a5586bd444796e394fca880289a |
|
MD5 | 2b27aa96bf7ea1ddf778b79057855ad2 |
|
BLAKE2b-256 | 99aa992a8f2d65613cdcc0cf79af8991177d92c8d3c1b919c8212a284db5f546 |
Provenance
The following attestation bundles were made for tilebox_storage-0.28.0.tar.gz
:
Publisher: GitHub
- Repository: tilebox/tilebox-python
- Workflow: publish_tilebox_storage.yml
-
Statement type: https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tilebox_storage-0.28.0.tar.gz
- Subject digest:
cb6a26704609d828f1fa83795f47ce30a5e28a5586bd444796e394fca880289a
- Transparency log index: 145197561
- Transparency log integration time:
- Predicate type:
File details
Details for the file tilebox_storage-0.28.0-py3-none-any.whl
.
File metadata
- Download URL: tilebox_storage-0.28.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59d62296ef64c7f9ca81b6b61e2a0bb56cfecc19b8940eea01f43b41881db31c |
|
MD5 | 1a9804e0eda5028f1dd211ab15be93f6 |
|
BLAKE2b-256 | 7b4487d67b4a2dd374c9cb84a932f544340cbd4fdbb1adb8a91672ace95b2b6c |
Provenance
The following attestation bundles were made for tilebox_storage-0.28.0-py3-none-any.whl
:
Publisher: GitHub
- Repository: tilebox/tilebox-python
- Workflow: publish_tilebox_storage.yml
-
Statement type: https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tilebox_storage-0.28.0-py3-none-any.whl
- Subject digest:
59d62296ef64c7f9ca81b6b61e2a0bb56cfecc19b8940eea01f43b41881db31c
- Transparency log index: 145197569
- Transparency log integration time:
- Predicate type: