Start in a Notebook

Check out the provided Sample Notebooks that you can use to get started with the Tilebox API. They provide a step-by-step guide to using the API and cover a wide variety of the features supported by Tilebox Python clients. You can also use the notebooks as a starting point for your own projects.

Start on your device

If you prefer to work locally in your device, the steps below help you 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
2

Create an API key

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

3

Query data

Use the datasets client to query data from a dataset.

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"))
4

Run a workflow task

Use the workflows client to create and submit a task.

from tilebox.workflows import Client, Task

class MyFirstTask(Task):
  def execute(self):
    print("Hello World from my first Tilebox task!")

client = Client(token="YOUR_TILEBOX_API_KEY")

# submit a job
jobs = client.jobs()
jobs.submit("my-very-first-job", MyFirstTask(), "some-compute-cluster")

# and run it
runner = client.runner("some-compute-cluster", tasks=[MyFirstTask])
runner.run_all()

For this snippet to work you need to have a cluster already created. Check out the guide on clusters to learn how to create one.

5

Explore further

Check out the following guides to learn more about the individual modules that make up Tilebox: