Metadata-Version: 2.1
Name: wandb-workspaces
Version: 0.1.7
Summary: A library for programatically working with the Weights & Biases UI.
Home-page: https://github.com/wandb/wandb-workspaces
License: Apache-2.0
Author: Weights & Biases
Author-email: support@wandb.com
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: data-generation
Provides-Extra: test
Requires-Dist: pydantic (>=2.7)
Requires-Dist: wandb (>=0.13.7)
Project-URL: Bug Reports, https://github.com/wandb/wandb-workspaces/issues
Project-URL: Documentation, https://docs.wandb.ai/
Project-URL: Repository, https://github.com/wandb/wandb-workspaces
Description-Content-Type: text/markdown

<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/main)](https://circleci.com/gh/wandb/wandb-workspaces) [![codecov](https://codecov.io/gh/wandb/wandb-workspaces/graph/badge.svg?token=XGL5D4023X)](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/796083f4-2aa6-432f-b585-c04abca9022f)

### 3. Create a report

```python
import wandb_workspaces.reports as wr

report = wr.Report(
    entity="your-entity",
    project="your-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"),
            ]
        ),
    ],
).save()
```

![image](https://github.com/wandb/wandb-workspaces/assets/15385696/25939b7c-1f2c-4df7-9936-692464e6e3fc)

## More examples

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

