Skip to main content

Storage client for Tilebox

Project description

Tilebox Logo

Documentation | Console

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tilebox_storage-0.27.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

tilebox_storage-0.27.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file tilebox_storage-0.27.2.tar.gz.

File metadata

  • Download URL: tilebox_storage-0.27.2.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

Hashes for tilebox_storage-0.27.2.tar.gz
Algorithm Hash digest
SHA256 b95af8cf85cb4b657dc0435970d5271581057321e12a58581d900f43bcbecee4
MD5 e00ac293996edbc27545b6e2c72cf9fb
BLAKE2b-256 ad8a751a754807bf6550ca0c8c97e4c74dabd49658232a5539e4fda1548e87a4

See more details on using hashes here.

File details

Details for the file tilebox_storage-0.27.2-py3-none-any.whl.

File metadata

File hashes

Hashes for tilebox_storage-0.27.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58b9f62a87f2c9eef8516d0667f6ade4c9b099548b6807ac3bfb0617b4aaba2f
MD5 740c374b15f77244a628b1fe5689822a
BLAKE2b-256 02dcd2e788fe92f707b76967246cbecc4954724618c28dc7905ba137fdf9cd0e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page