> ## Documentation Index
> Fetch the complete documentation index at: https://docs.athina.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Dataset

> You can get a specific dataset by ID or name.

Import the required classes and initialize Athina API key.

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

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

### Get Dataset By ID

```python
# Get a dataset by ID
try:
    dataset = Dataset.get_dataset_by_id(dataset_id=DATASET_ID)
except Exception as e:
    print(f"Failed to get dataset: {e}")
```

### Get Dataset By Name

<Tip>
  Dataset names are unique in Athina, which makes it possible to interact with
  datasets by name.
</Tip>

```python
# Get a dataset by Name
try:
    dataset = Dataset.get_dataset_by_name(name="test_dataset")
except Exception as e:
    print(f"Failed to get dataset: {e}")
```

### Get Dataset with Annotations

You can retrieve a dataset along with its annotations by setting the `include_dataset_annotations` parameter to `True`.

```python
# Get a dataset with annotations
try:
    # Using dataset ID
    dataset = Dataset.get_dataset_by_id(dataset_id=DATASET_ID, include_dataset_annotations=True)

    # Or using dataset name
    # dataset = Dataset.get_dataset_by_name(name="test_dataset", include_dataset_annotations=True)
except Exception as e:
    print(f"Failed to get dataset: {e}")
```
