Select your preferred language and follow the steps below to get started.

Start in a Notebook

Explore the provided Sample Notebooks to begin your journey with Tilebox. These notebooks offer a step-by-step guide to using the API and showcase many features supported by Tilebox Python clients. You can also use these notebooks as a foundation for your own projects.

Start on Your Device

If you prefer to work locally, follow these steps to get started.

1

Install Packages

Install the Tilebox Python packages. The easiest way to do this is using pip:

pip install tilebox-datasets tilebox-workflows tilebox-storage
2

Create an API Key

Create an API key by logging into the Tilebox Console, navigating to Account -> API Keys, and clicking the “Create API Key” button.

Copy the API key and keep it somewhere safe. You will need it to authenticate your requests.
3

Create a Cluster

Create a cluster by logging into the Tilebox Console, navigating to Workflows -> Clusters, and clicking the “Create cluster” button.

Copy the cluster slug, you will need it to run your workflows.
4

Query Data

Use the datasets client to query data from a dataset.

Python
from tilebox.datasets import Client

client = Client(token="YOUR_TILEBOX_API_KEY")

# select a dataset
datasets = client.datasets()
dataset = datasets.open_data.copernicus.sentinel2_msi

# and load data from a collection in a given time range
collection = dataset.collection("S2A_S2MSI1C")
data_january_2022 = collection.load(("2022-01-01", "2022-02-01"))
5

Run a Workflow

Use the workflows client to create a task and submit it as a job.

Python
from tilebox.workflows import Client, Task

# Replace with your actual cluster and token
cluster = "YOUR_COMPUTE_CLUSTER"
client = Client(token="YOUR_TILEBOX_API_KEY")

class HelloWorldTask(Task):
    greeting: str = "Hello"
    name: str = "World"

    def execute(self, context):
        print(f"{self.greeting} {self.name}, from the main task!")
        context.submit_subtask(HelloSubtask(name=self.name))

class HelloSubtask(Task):
    name: str

    def execute(self, context):
        print(f"Hello from the subtask, {self.name}!")

# Initiate the job
jobs = client.jobs()
jobs.submit("parameterized-hello-world", HelloWorldTask(greeting="Greetings", name="Universe"), cluster)

# Run the tasks
runner = client.runner(cluster, tasks=[HelloWorldTask, HelloSubtask])
runner.run_all()
6

Explore Further

Review the following guides to learn more about the modules that make up Tilebox: