Metadata-Version: 2.5
Name: signate-wandb-sync
Version: 0.1.1
Summary: A CLI tool to record SIGNATE competition scores to W&B
Project-URL: Homepage, https://github.com/yasumorishima/signate-wandb-sync
Project-URL: Repository, https://github.com/yasumorishima/signate-wandb-sync
Author: yasunorim
License-Expression: MIT
License-File: LICENSE
Keywords: competition,machine-learning,mlops,signate,wandb,weights-and-biases
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
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: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: click>=8.0
Requires-Dist: wandb>=0.16.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# signate-wandb-sync

A CLI tool to record SIGNATE competition scores to [Weights & Biases (W&B)](https://wandb.ai/).

Companion to [signate-deploy](https://github.com/yasumorishima/signate-deploy) — together they automate the full SIGNATE experiment tracking pipeline on GitHub Actions.

## Installation

```bash
pip install signate-wandb-sync
```

## Full Pipeline

```
[GitHub Actions]
  1. Download data via SIGNATE API  (signate-deploy)
  2. Run train.py — W&B run created, metrics logged
  3. Submit to SIGNATE              (signate-deploy)
  → W&B run URL printed to Actions log

[Local]
  4. Check score on SIGNATE leaderboard
  5. signate-wandb-sync score <W&B URL> --score 0.85 --rank 3
```

### Add W&B to train.py

```python
import wandb

run = wandb.init(project="my-signate-project", config={...})

# ... training and inference ...

wandb.log({"oof_score": oof_score})
print(f"W&B run URL: {run.url}")  # visible in Actions log
wandb.finish()
```

Set `WANDB_API_KEY` as a GitHub Secret:

```yaml
- name: Train and predict
  env:
    WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
  run: python train.py
```

## Commands

<!-- commands:start -->

### `signate-wandb-sync score`

Log SIGNATE submission scores to a W&B run.

```
signate-wandb-sync score [RUN_ID] [OPTIONS]
```

| Option | Description |
|---|---|
| `--project`, `-p` | W&B project path (entity/project). Required if RUN_ID is a bare ID. |
| `--score` | SIGNATE submission score. |
| `--rank` | Leaderboard rank. |
| `--metric`, `-m` | Additional metric (can be repeated, e.g. -m f1=0.85 -m auc=0.92). (default: `Sentinel.UNSET`) |

<!-- commands:end -->

## Windows

```bash
PYTHONUTF8=1 signate-wandb-sync score <run_id> --score 0.85
```

## Authentication

W&B: run `wandb login` beforehand, or set `WANDB_API_KEY` environment variable.

## Requirements

- Python 3.9+
- [wandb](https://pypi.org/project/wandb/)

## Related

- [signate-deploy](https://github.com/yasumorishima/signate-deploy) — Automate SIGNATE submission via GitHub Actions

## License

MIT
