> 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/de/sdks/pattern-cloud-folder-to-project.md).

# Muster: Cloud-Ordner ins Projekt

Python-SDK-Muster: neue Aufnahmen aus einem verbundenen S3-, GCS- oder Azure-Bucket zeitgesteuert in ein Projekt importieren, ohne Medien zu kopieren.

Nutzen Sie dieses Muster, wenn Roboter oder Flottenfahrzeuge Aufnahmen nach S3, GCS oder Azure schreiben und ein nächtlicher Job die neuen Aufnahmen zum Labeln einreihen soll.

```python
import os
from unitlab import UnitlabClient

PREFIX = "fleet/cell-04/2026-11-21/"

client = UnitlabClient()
try:
    storage = client.cloud_storages.get(os.environ["CLOUD_STORAGE_ID"])
    project = client.projects.get(os.environ["PROJECT_ID"])

    paths = [entry.name for entry in storage.browse(prefix=PREFIX, project=project)
             if entry.type == "file" and entry.is_extension_allowed]
    if not paths:
        raise SystemExit("Nothing new")

    batch = project.import_cloud(storage, paths, fps=2.0)
    status = batch.wait(timeout=3600)
    print(f"Imported {status.completed} of {status.total}, {status.failed} failed")
finally:
    client.close()
```

Übergeben Sie statt einzelner Dateien einen Ordnerpfad mit `/` am Ende, um ein ganzes Präfix zu importieren. Führen Sie pro Präfix einen Import aus und halten Sie die Batch-Queue-ID im Job-Log fest, damit ein erneuter Lauf prüfen kann, was bereits angekommen ist.

## Voraussetzungen <a href="#requirements" id="requirements"></a>

* Eine in der App angelegte Cloud-Speicher-Verbindung mit Lesezugriff auf den Bucket.
* Ein Schlüssel mit **Manage cloud storage** und **Manage data**.

## Verwandte Themen <a href="#related" id="related"></a>

[Cloud-Speicher](https://docs.unitlab.ai/api-sdk-cli/de/sdks/cloud-storage.md) · [Batch Queues und Verarbeitungsstatus](https://docs.unitlab.ai/api-sdk-cli/de/sdks/batch-queues-and-processing.md) · [CLI-Automatisierung und Exit-Verhalten](https://docs.unitlab.ai/api-sdk-cli/de/clis/cli-automation-and-exit-behavior.md)
