# EugoLab

EugoLab is a browser-based development environment for writing Python code on distributed compute resources.

Source: https://docs.eugo.io/docs/platform/eugolab/

---

EugoLab (called EugoIDE until November 2026) is your browser-based development environment for running Python code on Eugo's distributed infrastructure.

Write code in a familiar notebook interface. Your work runs on a cluster once you start one in the [EugoHPC Manager](/docs/guides/hpc-cluster-manager.md) panel, click its **Connect** button, and send tasks to it with [`eugo.hpc`](/docs/guides/eugo-hpc-api.md). Common libraries come [preinstalled](/docs/platform/libraries.md); to add a package of your own, see [Installing Python packages](/docs/guides/installing-python-packages.md).

```python title="Example - Using EugoLab" showLineNumbers
from pathlib import Path
from uuid import uuid4

from aws_lambda_powertools.logging import Logger
from fsspec import filesystem

svc_name = "eugo_example"
logger = Logger(svc_name)

class S3Data:
    def __init__(
        self, *, source_bucket: str, source_key_prefix: str, destination_bucket: str
    ) -> None:
        self.source_bucket = source_bucket
        self.source_key_prefix = source_key_prefix
        self.destination_bucket = destination_bucket
        self.s3fs = filesystem("s3")
        self.source_path_remote_prefix = (
            f"{self.source_bucket}/{self.source_key_prefix}"
        )
        self.source_local_path = f"/tmp/eugo/{self.source_path_remote_prefix}"

    def get_data(self):
        num_bytes = 1024

        source_size_in_gigabytes = round(
            float(self.s3fs.du(self.source_path_remote_prefix))
            / num_bytes
            / num_bytes
            / num_bytes,
            2,
        )
        logger.info(
            f"Using a folder w/ multiple datasets at '{self.source_path_remote_prefix}' w/ the size of {source_size_in_gigabytes}GB."
        )

        Path(self.source_local_path).parent.mkdir(parents=True, exist_ok=True)
        self.s3fs.get(self.source_path_remote_prefix, self.source_local_path)

    def put_data(self):
        destination_key_prefix = f"interactive_session_tests/{uuid4()}"
        logger.info(destination_key_prefix)
        self.s3fs.put(
            self.source_local_path,
            f"{self.destination_bucket}/{destination_key_prefix}",
        )

s3_data = S3Data(
    source_bucket="example_read_remote_bucket",
    source_key_prefix="example_key_prefix",
    destination_bucket="example_read_remote_bucket",
)

s3_data.get_data()
s3_data.put_data()
```

Annotations:

1. (line 4) `import` any of the 1000s of libraries available in EugoLab. In this case, we are using the `aws_lambda_powertools.logging.Logger` to log messages.
2. (line 11) Define the source bucket.
3. (line 14) Initialize the `s3fs` object to interact with an S3 bucket.
4. (line 23) Calculate the size of the source data and log it.
5. (line 35) Get the data from the source bucket and save it locally.
6. (line 40) Write the data to the destination bucket.

## Code Examples

EugoLab includes hundreds of demo notebooks to help you get started. Here are some common patterns:

### Data Processing with Pandas and AWS Wrangler

Read and write data from S3 using AWS Wrangler and pandas:

```python
import awswrangler as wr
import boto3
import pandas as pd
from datetime import date

boto3.setup_default_session(region_name="us-east-2")
wr.s3.does_object_exist("s3://noaa-ghcn-pds/fake", boto3_session=my_session)

bucket = "eugo-example-data"
path = f"s3://{bucket}/test/"

df = pd.DataFrame({
    "id": [1, 2],
    "value": ["foo", "boo"],
    "date": [date(2020, 1, 1), date(2020, 1, 2)]
})

wr.s3.to_parquet(
    df=df,
    path=path,
    dataset=True,
    mode="overwrite"
)

data = wr.s3.read_parquet(path, dataset=True)
print(data)
```

### Data Validation with Pydantic

Validate data structures using Pydantic's type system:

```python
from datetime import datetime
from pydantic import ValidationError, BaseModel, PositiveInt

class User(BaseModel):
    id: int
    name: str = 'John Doe'
    signup_ts: datetime | None
    tastes: dict[str, PositiveInt]

external_data = {'id': 'not an int', 'tastes': {}}

try:
    User(**external_data)
except ValidationError as error:
    print(error.errors())
```

This raises a `ValidationError` with detailed information about what failed:

```json
[
    {
        "type": "int_parsing",
        "loc": ["id"],
        "msg": "Input should be a valid integer, unable to parse string as an integer",
        "input": "not an int",
        "url": "https://errors.pydantic.dev/2/v/int_parsing"
    },
    {
        "type": "missing",
        "loc": ["signup_ts"],
        "msg": "Field required",
        "input": {"id": "not an int", "tastes": {}},
        "url": "https://errors.pydantic.dev/2/v/missing"
    }
]
```

## Python Runtime

EugoLab runs Python 3.14. To see the exact version in your session, run `python3 --version` in a terminal. We upgrade to newer Python versions once all pre-installed libraries are compatible.

All workspaces use the same Python version to ensure consistency across your organization.

## EugoLab Features

**Code completion** — Context-aware autocomplete for Python code, libraries, and your own functions.

**Syntax highlighting** — Clear visual formatting for Python syntax to improve readability.

**Type hints** — Inline type information and validation as you write code. Catch type errors before running your notebook.

**Amazon Q integration** — Optional AI assistant integration for code suggestions and explanations. Enable this from workspace settings.

## Getting Started

Access EugoLab from any deployed workspace:

1. Navigate to **Workspaces**
2. Select your workspace
3. Click **Open EugoLab**

EugoLab opens in a new browser tab with your workspace environment ready.

## Next Steps

- Browse [pre-installed libraries](/docs/platform/libraries.md) available in your workspace
- See what is kept when your session stops in [Saving your work](/docs/platform/saving-your-work.md)
- Create your first notebook following the [Quickstart guide](/docs/getting-started/quickstart.md)
- Learn about [workspace management](/docs/platform/workspaces.md) to organize your projects
