Skip to content

Project Document

app.domain.project.project_document

View source code

Defines serializable domain records used by project files.

See Also

Layer: Domain. Context: Defines application concepts without ui or infrastructure dependencies at this architectural boundary.

ProjectDirectories dataclass

Remember project-scoped import/export locations and filename affixes.

Layer: Domain. Context: A value object persisted with a project, separate from application preferences so reopening the project restores its own file locations.

ATTRIBUTE DESCRIPTION
last_import_directory

Most recently used source directory.

TYPE: str

last_export_directory

Most recently used destination directory.

TYPE: str

export_prefix

Prefix applied to exported filenames.

TYPE: str

export_suffix

Suffix applied to exported filenames.

TYPE: str

export_prefix: str = '' class-attribute instance-attribute

export_suffix: str = '' class-attribute instance-attribute

last_export_directory: str = '' class-attribute instance-attribute

last_import_directory: str = '' class-attribute instance-attribute

__init__(last_import_directory: str = '', last_export_directory: str = '', export_prefix: str = '', export_suffix: str = '') -> None

ProjectSessionDocument dataclass

Persist the reopenable state for one video session.

Layer: Domain. Context: Project serialization stores paths and plain-data settings/layers; runtime video handles and worker state are reconstructed when loading.

ATTRIBUTE DESCRIPTION
video_path

Path identifying the source video.

TYPE: str

current_frame_index

Frame to select when the session is restored.

TYPE: int

next_annotation_id

Next identifier available for manual annotations.

TYPE: int

settings

Serializable processing settings for the session.

TYPE: dict[str, object]

layers

Layer names mapped to frame-indexed box payloads.

TYPE: dict[str, dict[str, list[dict[str, object]]]]

current_frame_index: int instance-attribute

layers: dict[str, dict[str, list[dict[str, object]]]] instance-attribute

next_annotation_id: int instance-attribute

settings: dict[str, object] instance-attribute

video_path: str instance-attribute

__init__(video_path: str, current_frame_index: int, next_annotation_id: int, settings: dict[str, object], layers: dict[str, dict[str, list[dict[str, object]]]]) -> None

ProjectDocument dataclass

Top-level, versioned document for saving and restoring a project.

Layer: Domain. Context: This data-only object is the boundary between project orchestration and the JSON-backed infrastructure store.

ATTRIBUTE DESCRIPTION
format_version

Serialized schema version supported by the store.

TYPE: str

active_session_path

Video path of the active session, if any.

TYPE: str

directories

Project-local import/export locations and filename affixes.

TYPE: ProjectDirectories

sessions

Session documents included in the project.

TYPE: list[ProjectSessionDocument]

active_session_path: str = '' class-attribute instance-attribute

directories: ProjectDirectories = field(default_factory=ProjectDirectories) class-attribute instance-attribute

format_version: str = '1.0' class-attribute instance-attribute

sessions: list[ProjectSessionDocument] = field(default_factory=list) class-attribute instance-attribute

__init__(format_version: str = '1.0', active_session_path: str = '', directories: ProjectDirectories = ProjectDirectories(), sessions: list[ProjectSessionDocument] = list()) -> None