Import the required classes and initialize Athina API key.

import os
from athina_client.datasets import Dataset
from athina_client.keys import AthinaApiKey

AthinaApiKey.set_key(os.getenv('ATHINA_API_KEY'))

Now you can list all datasets.

# List all datasets
try:
    datasets = Dataset.list_datasets()
except Exception as e:
    print(f"Failed to list datasets: {e}")