> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/ja/sdks/pattern-assets-to-a-release.md).

# パターン：Assets からリリースまで

Unitlab Python SDK でロボットの記録をライブラリにアップロードし、データセットバージョンを公開してプロジェクトにアタッチし、レビュー済みの作業をリリースとしてエクスポートする一連の流れを示します。

同じファイルを複数のプロジェクトで使う場合や、すべてのリリースを特定のデータセットバージョンまで追跡できるようにしたい場合に使います。

```python
from unitlab import UnitlabClient

client = UnitlabClient()
try:
    # 1. Store the files once in the library.
    uploaded = client.assets.upload("./cell-04", folder="Robot cell 04", tags=["2026-11"])
    if uploaded.failed:
        raise SystemExit(f"{len(uploaded.failed)} files failed to upload")

    # 2. Freeze a curated selection.
    dataset = client.datasets.create("Bin picking - training", folder_ids=[uploaded.folder_id])
    version = dataset.publish_version("v1: cell 04")

    # 3. Label it in a project.
    project = client.projects.get("PROJECT_ID")
    result = project.attach(dataset_versions=[{"dataset_id": dataset.id, "version_number": version.version_number}])
    project.batch_queue(result.batch_queue_id).wait()

    # ...annotate and review in the app...

    # 4. Export reviewed work.
    release = client.releases.create(project, export_type="COCO", completed_only=True)
    print(release.download(dest="./export"))
finally:
    client.close()
```

## この順序にする理由 <a href="#why-this-order" id="why-this-order"></a>

| ステップ                  | 得られるもの                              |
| --------------------- | ----------------------------------- |
| ライブラリへのアップロード         | 各ファイルの単一コピーを複数プロジェクトで再利用            |
| 公開バージョン               | モデルカードに記載できる固定のファイルリスト              |
| バージョン番号でのアタッチ         | 後でデータセットが変わっても、プロジェクトは正確にそのリストを受け取る |
| `completed_only` リリース | レビュー済みのアイテムだけが学習に使われる               |

データセット ID、バージョン番号、リリース ID を学習実行と一緒に記録してください。

## 関連情報 <a href="#related" id="related"></a>

[データセット](https://docs.unitlab.ai/api-sdk-cli/ja/sdks/datasets.md) · [ライブラリデータのアタッチとデタッチ](https://docs.unitlab.ai/api-sdk-cli/ja/sdks/attach-and-detach-project-sources.md) · [リリースの作成とダウンロード](https://docs.unitlab.ai/api-sdk-cli/ja/sdks/create-and-download-releases.md)
