-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(utils): move typed classes into separate file
- Loading branch information
1 parent
d9bd19e
commit a5534c4
Showing
2 changed files
with
106 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
"""Typed dictionaries used for representing source descriptions.""" | ||
|
||
from typing import List, NotRequired, TypedDict | ||
|
||
|
||
############################################ | ||
# Typed Classes | ||
############################################ | ||
class Row(TypedDict): | ||
"""A typed dictionary that represents a row of a system.""" | ||
rowType: str | ||
rowBase: str | ||
rowNumber: str | ||
|
||
|
||
class System(TypedDict): | ||
"""A typed dictionary that represents a system.""" | ||
system: str | ||
measure: str | ||
linkTo: str | ||
row: NotRequired[Row] | ||
|
||
|
||
class Folio(TypedDict): | ||
"""A typed dictionary that represents a folio.""" | ||
folio: str | ||
folioLinkTo: str | ||
folioDescription: str | ||
systemGroups: List[List[System]] | ||
|
||
|
||
class ContentItem(TypedDict): | ||
"""A typed dictionary that represents a content item.""" | ||
item: str | ||
itemLinkTo: str | ||
itemDescription: str | ||
folios: List[Folio] | ||
|
||
|
||
class WritingInstruments(TypedDict): | ||
"""A typed dictionary that represents a set of writing instruments.""" | ||
main: str | ||
secondary: List[str] | ||
|
||
|
||
class Description(TypedDict): | ||
"""A typed dictionary that represents a description of a source description.""" | ||
desc: List[str] | ||
writingMaterialString: str | ||
writingInstruments: WritingInstruments | ||
title: str | ||
date: str | ||
pagination: str | ||
measureNumbers: str | ||
instrumentation: str | ||
annotations: str | ||
content: List[ContentItem] | ||
|
||
|
||
class SourceDescription(TypedDict): | ||
"""A typed dictionary that represents a source description.""" | ||
id: str | ||
siglum: str | ||
siglumAddendum: str | ||
type: str | ||
location: str | ||
description: Description | ||
|
||
|
||
class SourceList(TypedDict): | ||
"""A typed dictionary that represents a list of source descriptions.""" | ||
sources: List[SourceDescription] | ||
|
||
|
||
class LinkBox(TypedDict): | ||
"""A typed dictionary that represents a link box.""" | ||
svgGroupId: str | ||
linkTo: str | ||
|
||
|
||
class TextcriticalComment(TypedDict): | ||
"""A typed dictionary that represents a textcritical comment.""" | ||
svgGroupId: str | ||
measure: str | ||
system: str | ||
position: str | ||
comment: str | ||
|
||
|
||
class TextCritics(TypedDict): | ||
"""A typed dictionary that represents a textcritics object.""" | ||
id: str | ||
label: str | ||
description: List | ||
rowTable: bool | ||
comments: List[TextcriticalComment] | ||
linkBoxes: List[LinkBox] | ||
|
||
|
||
class TextcriticsList(TypedDict): | ||
"""A typed dictionary that represents a list of textcritics objects.""" | ||
textcritics: List[TextCritics] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters