Skip to content

client.projects

Bases: SyncResource

Sync projects namespace (client.projects).

create

create(*, name: str, dataset_id: UUID | str, scope: ProjectScopeParam, classes: list[ClassSpecParam] | None = None, image_classifications: list[ImageClassificationSpecParam] | None = None, description: str | None = None, dataset_kind: DatasetKind | str = DatasetKind.IMAGE, assignment_mode: AssignmentMode | str = AssignmentMode.SELF_CLAIM, tag_config: TagConfigParam | None = None) -> Project

Create a labeling project over a dataset subset.

Parameters:

Name Type Description Default
name str

display name (NOT unique — two projects may share a name; disambiguate by id).

required
dataset_id UUID | str

source dataset.

required
scope ProjectScopeParam

which assets are in-project — {"all": true} | {"asset_ids": [...]} | {"filter": {...AssetFilter}}.

required
classes list[ClassSpecParam] | None

object-class specs (name/color/allowed_types [+ keypoint_topology for keypoint classes, + inline attributes]).

None
image_classifications list[ImageClassificationSpecParam] | None

image-level classification class specs.

None
assignment_mode AssignmentMode | str

self_claim (labelers claim) or manual.

SELF_CLAIM

Raises:

Type Description
ForbiddenError

caller is not a workspace admin (ADR-0047).

ConflictError

tenant project cap reached (RESOURCE_LIMIT_EXCEEDED).

UnprocessableError

invalid scope/class specs.

list

list(*, dataset_id: UUID | str | None = None, status: ProjectStatus | str | None = None, dataset_kind: DatasetKind | str | None = None, q: str | None = None, created_at_from: datetime | str | None = None, created_at_to: datetime | str | None = None, include_total: bool = False, limit: int | None = None, cursor: str | None = None) -> Page[Project]

List projects, newest first (cursor-paginated; iterate for all pages).

Parameters:

Name Type Description Default
q str | None

case-insensitive substring on the name.

None
include_total bool

also populate page.total (costs a COUNT).

False

Raises:

Type Description
UnprocessableError

invalid enum filter value.

get

get(project_id: UUID | str) -> Project

Fetch one project (includes progress counters).

Raises:

Type Description
NotFoundError

PROJECT_NOT_FOUND.

update

update(project_id: UUID | str, *, name: str | None = None, description: str | None = None, assignment_mode: AssignmentMode | str | None = None) -> Project

Partial update (only the fields you pass change).

Note: project names are NOT unique — renaming to an existing name succeeds (unlike datasets/versions/models).

progress

progress(project_id: UUID | str) -> ProjectProgress

Workflow counters (total/to_label/in_progress/in_review/done/skipped) — a complete snapshot, not a page. total sums every state, skipped included (ADR-0110).

archive

archive(project_id: UUID | str) -> None

Soft-archive (hides from active lists; no data is deleted). Returns nothing — the server responds 204.

unarchive

unarchive(project_id: UUID | str) -> None

Restore an archived project to active (204).

duplicate

duplicate(project_id: UUID | str, *, name: str | None = None, copy_annotations: bool = False) -> Project

Clone a project (scope + classes [+ annotations when asked]).

Raises:

Type Description
ConflictError

tenant project cap reached (RESOURCE_LIMIT_EXCEEDED).

Response models

Models returned by client.projects methods (fields, types, and what each means).

Project domain models (the P1 exemplar — P2 modules follow this shape).

Conventions demonstrated here (STYLE.md §types): - Response models: extra="allow" (tolerant reader), every field typed to the wire contract, enums from common — never re-declared. - Request bodies are built as plain dicts inside resources (the server validates); a request MODEL exists only where callers benefit from constructing it (e.g. TagConfig round-trips between read and write).

TagConfigEntry

Bases: BaseModel

One palette tag: canonical value + optional display/color hints.

TagConfig

Bases: BaseModel

The project's authoritative tag palette (ADR-0058). free_form=True auto-registers unseen tags on apply; False rejects them.

ProjectProgress

Bases: BaseModel

Workflow counters over the project's assets (a complete snapshot, not a page).

total is the sum of all state counters below, including skipped.

Project

Bases: BaseModel

One labeling project: a dataset subset + class vocabulary + workflow.

ClassSpec

Bases: BaseModel

Input spec for one OBJECT class at project create: name + color + which geometry types shapes of this class may use. Optional per-class keypoint_topology (COCO-style nodes/edges) and inline attributes.