semvec/pypi-packages huggingface dataset:
wandb_workspaces 0.1.1
A library for programatically working with the Weights & Biases UI.
License: MIT
Requires Python: <4.0,>=3.9

<div align="center">
  <img src="https://i.imgur.com/RUtiVzH.png" width="600" /><br><br>
</div>

# wandb_workspaces

[![PyPI](https://img.shields.io/pypi/v/wandb_workspaces)](https://pypi.python.org/pypi/wandb_workspaces) [![CircleCI](https://img.shields.io/circleci/build/github/wandb/wandb_workspaces/master)](https://circleci.com/gh/wandb/wandb_workspaces) [![Codecov](https://img.shields.io/codecov/c/gh/wandb/wandb_workspaces)](https://codecov.io/gh/wandb/wandb_workspaces)

`wandb_workspaces` is a Python library for programatically working with [Weights & Biases](https://wandb.ai) workspaces and reports.

## Quickstart

### 1. Install

```bash
pip install wandb_workspaces
```

OR, you can install this as an extra from the wandb library:

```bash
pip install wandb[workspaces]
```

### 2. Create a workspace

```python
import wandb_workspaces.workspaces as ws

workspace = ws.Workspace(
   name="Example W&B Workspace",
   entity="your-entity",
   project="your-project",
   sections=[
      ws.Section(
            name="Validation Metrics",
            panels=[
               wr.LinePlot(x="Step", y=["val_loss"]),
               wr.BarPlot(metrics=["val_accuracy"]),
               wr.ScalarChart(metric="f1_score", groupby_aggfunc="mean"),
            ],
            is_open=True,
      ),
   ],
).save()
```

![image](https://github.com/wandb/wandb-workspaces/assets/15385696/a526eb45-d84c-482a-9681-d9048a29641e)

### 3. Create a report

```python
import wandb_workspaces.reports as wr

report = wr.Report(
    entity=entity,
    project=project,
    title="Example W&B Report",
    blocks=[
        wr.H1("This is a heading"),
        wr.P("Some amazing insightful text about your project"),
        wr.H2(
            "This heading is collapsed",
            collapsed_blocks=[wr.P("Our model is great!")],
        ),
        wr.PanelGrid(
            panels=[
                wr.LinePlot(x="Step", y=["val_loss"]),
                wr.BarPlot(metrics=["val_accuracy"]),
                wr.ScalarChart(metric="f1_score", groupby_aggfunc="mean"),
            ]
        ),
    ],
)
```

![image](https://github.com/wandb/wandb-workspaces/assets/15385696/9c3a39db-224b-40a7-ad29-e1cb33232909)

## More examples

See [examples](https://github.com/wandb/wandb-workspaces/tree/master/examples) for more detailed usage.