Passed
Pull Request — master (#974)
by Konstantin
02:57
created

ocrd_network.models.workspace   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 14
dl 0
loc 30
rs 10
c 0
b 0
f 0
1
from beanie import Document
2
from typing import Optional
3
4
5
class DBWorkspace(Document):
6
    """
7
    Model to store a workspace in the mongo-database.
8
9
    Information to handle workspaces and from bag-info.txt are stored here.
10
11
    Attributes:
12
        ocrd_identifier             Ocrd-Identifier (mandatory)
13
        bagit_profile_identifier    BagIt-Profile-Identifier (mandatory)
14
        ocrd_base_version_checksum  Ocrd-Base-Version-Checksum (mandatory)
15
        ocrd_mets                   Ocrd-Mets (optional)
16
        bag_info_adds               bag-info.txt can also (optionally) contain additional
17
                                    key-value-pairs which are saved here
18
    """
19
    workspace_id: str
20
    workspace_mets_path: str
21
    ocrd_identifier: str
22
    bagit_profile_identifier: str
23
    ocrd_base_version_checksum: Optional[str]
24
    ocrd_mets: Optional[str]
25
    bag_info_adds: Optional[dict]
26
    deleted: bool = False
27
28
    class Settings:
29
        name = "workspace"
30