ods-types-py 0.1.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ods_types/__init__.py +109 -0
- ods_types/common.py +44 -0
- ods_types/enums.py +344 -0
- ods_types_py-0.1.7.dist-info/METADATA +95 -0
- ods_types_py-0.1.7.dist-info/RECORD +7 -0
- ods_types_py-0.1.7.dist-info/WHEEL +5 -0
- ods_types_py-0.1.7.dist-info/top_level.txt +1 -0
ods_types/__init__.py
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ODS Types - Python Implementation
|
|
3
|
+
Core types and enums for the ODS (Optikka Design System).
|
|
4
|
+
Python equivalent of @optikka/ods-types npm package.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.1"
|
|
8
|
+
|
|
9
|
+
# Re-export all enums
|
|
10
|
+
from ods_types.enums import (
|
|
11
|
+
# Renderer enums
|
|
12
|
+
Kind,
|
|
13
|
+
TargetKind,
|
|
14
|
+
FadeKind,
|
|
15
|
+
Easing,
|
|
16
|
+
Dimension,
|
|
17
|
+
AlignX,
|
|
18
|
+
AlignY,
|
|
19
|
+
LayerKind,
|
|
20
|
+
TextKind,
|
|
21
|
+
FillKind,
|
|
22
|
+
DropZoneMode,
|
|
23
|
+
SlideKind,
|
|
24
|
+
StackDir,
|
|
25
|
+
StackAlign,
|
|
26
|
+
ClampAxes,
|
|
27
|
+
AspectMode,
|
|
28
|
+
ScaleMode,
|
|
29
|
+
# Data layer enums
|
|
30
|
+
HTTPMethod,
|
|
31
|
+
ImageMimeType,
|
|
32
|
+
FontMimeType,
|
|
33
|
+
ReviewStatusEnum,
|
|
34
|
+
ImageTypeEnum,
|
|
35
|
+
BatchTypeEnum,
|
|
36
|
+
BatchStatusEnum,
|
|
37
|
+
ExecutionStatusEnum,
|
|
38
|
+
DesignDataInputTypes,
|
|
39
|
+
TextType,
|
|
40
|
+
RequiredFieldType,
|
|
41
|
+
CanvasGuideKind,
|
|
42
|
+
CanvasGridKind,
|
|
43
|
+
BentoAxis,
|
|
44
|
+
RenderRunStatus,
|
|
45
|
+
RenderRunQueueEventType,
|
|
46
|
+
TemplateInputJobStatus,
|
|
47
|
+
ColorType,
|
|
48
|
+
BrandRuleType,
|
|
49
|
+
BrandRuleTarget,
|
|
50
|
+
DataType,
|
|
51
|
+
ODSObjectType,
|
|
52
|
+
WhenToUseLogoEnum,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Re-export all common types
|
|
56
|
+
from ods_types.common import (
|
|
57
|
+
Target,
|
|
58
|
+
Box,
|
|
59
|
+
DrawImageParams,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
__all__ = [
|
|
63
|
+
# Renderer enums
|
|
64
|
+
"Kind",
|
|
65
|
+
"TargetKind",
|
|
66
|
+
"FadeKind",
|
|
67
|
+
"Easing",
|
|
68
|
+
"Dimension",
|
|
69
|
+
"AlignX",
|
|
70
|
+
"AlignY",
|
|
71
|
+
"LayerKind",
|
|
72
|
+
"TextKind",
|
|
73
|
+
"FillKind",
|
|
74
|
+
"DropZoneMode",
|
|
75
|
+
"SlideKind",
|
|
76
|
+
"StackDir",
|
|
77
|
+
"StackAlign",
|
|
78
|
+
"ClampAxes",
|
|
79
|
+
"AspectMode",
|
|
80
|
+
"ScaleMode",
|
|
81
|
+
# Data layer enums
|
|
82
|
+
"HTTPMethod",
|
|
83
|
+
"ImageMimeType",
|
|
84
|
+
"FontMimeType",
|
|
85
|
+
"ReviewStatusEnum",
|
|
86
|
+
"ImageTypeEnum",
|
|
87
|
+
"BatchTypeEnum",
|
|
88
|
+
"BatchStatusEnum",
|
|
89
|
+
"ExecutionStatusEnum",
|
|
90
|
+
"DesignDataInputTypes",
|
|
91
|
+
"TextType",
|
|
92
|
+
"RequiredFieldType",
|
|
93
|
+
"CanvasGuideKind",
|
|
94
|
+
"CanvasGridKind",
|
|
95
|
+
"BentoAxis",
|
|
96
|
+
"RenderRunStatus",
|
|
97
|
+
"RenderRunQueueEventType",
|
|
98
|
+
"TemplateInputJobStatus",
|
|
99
|
+
"ColorType",
|
|
100
|
+
"BrandRuleType",
|
|
101
|
+
"BrandRuleTarget",
|
|
102
|
+
"DataType",
|
|
103
|
+
"ODSObjectType",
|
|
104
|
+
# Common types
|
|
105
|
+
"Target",
|
|
106
|
+
"Box",
|
|
107
|
+
"DrawImageParams",
|
|
108
|
+
"WhenToUseLogoEnum",
|
|
109
|
+
]
|
ods_types/common.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ODS Types - Common Types
|
|
3
|
+
Common type definitions for the ODS (Optikka Design System) renderer.
|
|
4
|
+
Python equivalent of @optikka/ods-types/common
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import TypedDict, Optional
|
|
8
|
+
from ods_types.enums import TargetKind
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Target(TypedDict, total=False):
|
|
12
|
+
"""
|
|
13
|
+
Target reference for design elements.
|
|
14
|
+
Specifies what element a verb or action should target.
|
|
15
|
+
"""
|
|
16
|
+
kind: TargetKind
|
|
17
|
+
id: Optional[str]
|
|
18
|
+
layerId: Optional[str]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Box(TypedDict):
|
|
22
|
+
"""
|
|
23
|
+
Box represents a rectangular region with position and dimensions.
|
|
24
|
+
Used throughout the rendering system for positioning and sizing.
|
|
25
|
+
"""
|
|
26
|
+
x: float
|
|
27
|
+
y: float
|
|
28
|
+
w: float
|
|
29
|
+
h: float
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class DrawImageParams(TypedDict):
|
|
33
|
+
"""
|
|
34
|
+
Parameters for ctx.drawImage() - used for rendering images with different objectFit modes.
|
|
35
|
+
Maps to HTML Canvas API drawImage() method parameters.
|
|
36
|
+
"""
|
|
37
|
+
sx: float # Source X (crop start)
|
|
38
|
+
sy: float # Source Y (crop start)
|
|
39
|
+
sWidth: float # Source width (crop width)
|
|
40
|
+
sHeight: float # Source height (crop height)
|
|
41
|
+
dx: float # Destination X
|
|
42
|
+
dy: float # Destination Y
|
|
43
|
+
dWidth: float # Destination width
|
|
44
|
+
dHeight: float # Destination height
|
ods_types/enums.py
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ODS Types - Enums
|
|
3
|
+
Core enumerations for the ODS (Optikka Design System).
|
|
4
|
+
Contains both renderer enums and data layer enums used across microservices.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# =============================================================================
|
|
11
|
+
# RENDERER ENUMS - Used by the frontend/renderer
|
|
12
|
+
# =============================================================================
|
|
13
|
+
|
|
14
|
+
class Kind(str, Enum):
|
|
15
|
+
"""Kind of design element"""
|
|
16
|
+
CANVAS = "canvas"
|
|
17
|
+
LAYER = "layer"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class TargetKind(str, Enum):
|
|
21
|
+
"""Target reference types"""
|
|
22
|
+
CANVAS = "canvas"
|
|
23
|
+
LAYER = "layer"
|
|
24
|
+
GUIDE = "guide"
|
|
25
|
+
SELF = "self"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class FadeKind(str, Enum):
|
|
29
|
+
"""Fade animation types"""
|
|
30
|
+
PHASE = "phase"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Easing(str, Enum):
|
|
34
|
+
"""Animation easing functions"""
|
|
35
|
+
EASE_IN = "easeIn"
|
|
36
|
+
EASE_OUT = "easeOut"
|
|
37
|
+
EASE_IN_OUT = "easeInOut"
|
|
38
|
+
LINEAR = "linear"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class Dimension(str, Enum):
|
|
42
|
+
"""Dimension types"""
|
|
43
|
+
WIDTH = "width"
|
|
44
|
+
HEIGHT = "height"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class AlignX(str, Enum):
|
|
48
|
+
"""Horizontal alignment options"""
|
|
49
|
+
LEFT = "left"
|
|
50
|
+
CENTER = "center"
|
|
51
|
+
RIGHT = "right"
|
|
52
|
+
MIDDLE = "middle"
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class AlignY(str, Enum):
|
|
56
|
+
"""Vertical alignment options"""
|
|
57
|
+
TOP = "top"
|
|
58
|
+
CENTER = "center"
|
|
59
|
+
MIDDLE = "middle"
|
|
60
|
+
BOTTOM = "bottom"
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class LayerKind(str, Enum):
|
|
64
|
+
"""Layer reference types"""
|
|
65
|
+
SELF = "self"
|
|
66
|
+
OTHER = "other" # other layer by id
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class TextKind(str, Enum):
|
|
70
|
+
"""Text visibility types"""
|
|
71
|
+
PUBLIC = "public"
|
|
72
|
+
PRIVATE = "private"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class FillKind(str, Enum):
|
|
76
|
+
"""Fill visibility types"""
|
|
77
|
+
PUBLIC = "public"
|
|
78
|
+
PRIVATE = "private"
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class DropZoneMode(str, Enum):
|
|
82
|
+
"""Drop zone fit modes"""
|
|
83
|
+
CONTAIN = "contain"
|
|
84
|
+
COVER = "cover"
|
|
85
|
+
FIT_WIDTH = "fitWidth"
|
|
86
|
+
FIT_HEIGHT = "fitHeight"
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class SlideKind(str, Enum):
|
|
90
|
+
"""Slide animation types"""
|
|
91
|
+
CANVAS = "canvas"
|
|
92
|
+
LAYER = "layer"
|
|
93
|
+
PHASE = "phase"
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class StackDir(str, Enum):
|
|
97
|
+
"""Stack direction"""
|
|
98
|
+
RIGHT = "right"
|
|
99
|
+
LEFT = "left"
|
|
100
|
+
UP = "up"
|
|
101
|
+
DOWN = "down"
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class StackAlign(str, Enum):
|
|
105
|
+
"""Stack alignment"""
|
|
106
|
+
START = "start"
|
|
107
|
+
CENTER = "center"
|
|
108
|
+
END = "end"
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class ClampAxes(str, Enum):
|
|
112
|
+
"""Clamp axes options"""
|
|
113
|
+
X = "x"
|
|
114
|
+
Y = "y"
|
|
115
|
+
BOTH = "both"
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class AspectMode(str, Enum):
|
|
119
|
+
"""Aspect ratio modes"""
|
|
120
|
+
CONTAIN = "contain"
|
|
121
|
+
COVER = "cover"
|
|
122
|
+
FIT_WIDTH = "fitWidth"
|
|
123
|
+
FIT_HEIGHT = "fitHeight"
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class ScaleMode(str, Enum):
|
|
127
|
+
"""Scaling modes for images and layers"""
|
|
128
|
+
WIDTH = "width"
|
|
129
|
+
HEIGHT = "height"
|
|
130
|
+
MIN_SIDE = "minSide"
|
|
131
|
+
MAX_SIDE = "maxSide"
|
|
132
|
+
HEIGHT_FROM_WIDTH = "heightFromWidth"
|
|
133
|
+
WIDTH_FROM_HEIGHT = "widthFromHeight"
|
|
134
|
+
WIDTH_FROM_MIN_SIDE = "widthFromMinSide"
|
|
135
|
+
WIDTH_FROM_MAX_SIDE = "widthFromMaxSide"
|
|
136
|
+
HEIGHT_FROM_MIN_SIDE = "heightFromMinSide"
|
|
137
|
+
HEIGHT_FROM_MAX_SIDE = "heightFromMaxSide"
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
# =============================================================================
|
|
141
|
+
# DATA LAYER ENUMS - Used by backend microservices
|
|
142
|
+
# =============================================================================
|
|
143
|
+
|
|
144
|
+
class HTTPMethod(str, Enum):
|
|
145
|
+
"""HTTP method"""
|
|
146
|
+
GET = "GET"
|
|
147
|
+
POST = "POST"
|
|
148
|
+
PUT = "PUT"
|
|
149
|
+
PATCH = "PATCH"
|
|
150
|
+
DELETE = "DELETE"
|
|
151
|
+
OPTIONS = "OPTIONS"
|
|
152
|
+
HEAD = "HEAD"
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class ImageMimeType(str, Enum):
|
|
156
|
+
"""Image MIME types supported by ODS"""
|
|
157
|
+
JPEG = "image/jpeg"
|
|
158
|
+
PNG = "image/png"
|
|
159
|
+
GIF = "image/gif"
|
|
160
|
+
WEBP = "image/webp"
|
|
161
|
+
SVG = "image/svg+xml"
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class ReviewStatusEnum(str, Enum):
|
|
165
|
+
"""Review status for workflow execution results"""
|
|
166
|
+
APPROVED = "APPROVED"
|
|
167
|
+
PENDING = "PENDING"
|
|
168
|
+
REJECTED = "REJECTED"
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class ImageTypeEnum(str, Enum):
|
|
172
|
+
"""Image type classification"""
|
|
173
|
+
ORIGINAL = "ORIGINAL"
|
|
174
|
+
WORK_IN_PROGRESS = "WORK_IN_PROGRESS"
|
|
175
|
+
LEAF = "LEAF"
|
|
176
|
+
DEBUG = "DEBUG"
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class BatchTypeEnum(str, Enum):
|
|
180
|
+
"""Workflow batch type"""
|
|
181
|
+
UPLOAD = "UPLOAD"
|
|
182
|
+
DOWNLOAD = "DOWNLOAD"
|
|
183
|
+
SHARED = "SHARED"
|
|
184
|
+
WORKFLOW_RUN = "WORKFLOW_RUN"
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class BatchStatusEnum(str, Enum):
|
|
188
|
+
"""Workflow batch status"""
|
|
189
|
+
QUEUED = "QUEUED"
|
|
190
|
+
RUNNING = "RUNNING"
|
|
191
|
+
COMPLETED = "COMPLETED"
|
|
192
|
+
FAILED = "FAILED"
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class ExecutionStatusEnum(str, Enum):
|
|
196
|
+
"""Kore execution status"""
|
|
197
|
+
QUEUED = "QUEUED"
|
|
198
|
+
RUNNING = "RUNNING"
|
|
199
|
+
COMPLETED = "COMPLETED"
|
|
200
|
+
FAILED = "FAILED"
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class DesignDataInputTypes(str, Enum):
|
|
204
|
+
"""Design data input types"""
|
|
205
|
+
ASSETS = "assets"
|
|
206
|
+
LOGOS = "logos"
|
|
207
|
+
TEXTS = "texts"
|
|
208
|
+
EXTRA_DATA = "extra_data"
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class TextType(str, Enum):
|
|
212
|
+
"""Text input type for template specs"""
|
|
213
|
+
SELECT = "select"
|
|
214
|
+
NUMBER = "number"
|
|
215
|
+
STRING = "string"
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class RequiredFieldType(str, Enum):
|
|
219
|
+
"""Required field types for group specifications"""
|
|
220
|
+
TEXTS = "texts"
|
|
221
|
+
ASSETS = "assets"
|
|
222
|
+
LOGOS = "logos"
|
|
223
|
+
|
|
224
|
+
class FontMimeType(str, Enum):
|
|
225
|
+
"""Font MIME types supported by ODS"""
|
|
226
|
+
TTF = "font/ttf"
|
|
227
|
+
OTF = "font/otf"
|
|
228
|
+
WOFF = "font/woff"
|
|
229
|
+
WOFF2 = "font/woff2"
|
|
230
|
+
EOT = "font/eot"
|
|
231
|
+
SVG = "font/svg"
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class CanvasGuideKind(str, Enum):
|
|
235
|
+
"""Canvas guide kind"""
|
|
236
|
+
BOX = "box"
|
|
237
|
+
POINT = "point"
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
class CanvasGridKind(str, Enum):
|
|
241
|
+
"""Canvas grid type"""
|
|
242
|
+
SIMPLE = "simple"
|
|
243
|
+
BENTO = "bento"
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
class BentoAxis(str, Enum):
|
|
247
|
+
"""Bento grid axis"""
|
|
248
|
+
ROW = "row"
|
|
249
|
+
COL = "col"
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class RenderRunStatus(str, Enum):
|
|
253
|
+
"""Render run status"""
|
|
254
|
+
PENDING = "pending"
|
|
255
|
+
QUEUED = "queued"
|
|
256
|
+
PROCESSING = "processing"
|
|
257
|
+
COMPLETED = "completed"
|
|
258
|
+
FAILED = "failed"
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class RenderRunQueueEventType(str, Enum):
|
|
262
|
+
"""Render run event type"""
|
|
263
|
+
RENDER = "render"
|
|
264
|
+
FINISH_RENDER_RUN = "finish_render_run"
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class TemplateInputJobStatus(str, Enum):
|
|
268
|
+
"""Target input job status"""
|
|
269
|
+
PENDING = "PENDING"
|
|
270
|
+
COMPLETED = "COMPLETED"
|
|
271
|
+
FAILED = "FAILED"
|
|
272
|
+
IN_PROGRESS = "IN_PROGRESS"
|
|
273
|
+
SUBMITTED = "SUBMITTED"
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class ColorType(str, Enum):
|
|
277
|
+
"""Color type classification"""
|
|
278
|
+
PRIMARY = "primary"
|
|
279
|
+
SECONDARY = "secondary"
|
|
280
|
+
TERTIARY = "tertiary"
|
|
281
|
+
ACCENT = "accent"
|
|
282
|
+
NEUTRAL = "neutral"
|
|
283
|
+
BACKGROUND = "background"
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
class BrandRuleType(str, Enum):
|
|
287
|
+
"""Brand rule type"""
|
|
288
|
+
COLOR = "color"
|
|
289
|
+
LOGO = "logo"
|
|
290
|
+
FONT = "font"
|
|
291
|
+
TYPOGRAPHY = "typography"
|
|
292
|
+
VISUAL_IDENTITY = "visual_identity"
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
class BrandRuleTarget(str, Enum):
|
|
296
|
+
"""Brand rule target"""
|
|
297
|
+
LOGO = "logo"
|
|
298
|
+
COLOR = "color"
|
|
299
|
+
FONT = "font"
|
|
300
|
+
TYPOGRAPHY = "typography"
|
|
301
|
+
VISUAL_IDENTITY = "visual_identity"
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class DataType(str, Enum):
|
|
305
|
+
"""Data type for entity attributes"""
|
|
306
|
+
STRING = "string"
|
|
307
|
+
NUMBER = "number"
|
|
308
|
+
BOOLEAN = "boolean"
|
|
309
|
+
DATE = "date"
|
|
310
|
+
TIME = "time"
|
|
311
|
+
DATETIME = "datetime"
|
|
312
|
+
ENUM = "enum"
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
class ODSObjectType(str, Enum):
|
|
316
|
+
"""ODS object type"""
|
|
317
|
+
#Brand objects
|
|
318
|
+
BRAND = "brand"
|
|
319
|
+
BRAND_REGISTRY = "brand_registry"
|
|
320
|
+
|
|
321
|
+
#Template objects
|
|
322
|
+
TEMPLATE_REGISTRY = "template_registry"
|
|
323
|
+
TEMPLATE_INPUT = "template_input"
|
|
324
|
+
|
|
325
|
+
#Pre render objects and render run objects
|
|
326
|
+
TEMPLATE_INPUT_JOB = "template_input_job"
|
|
327
|
+
RENDER_RUN = "render_run"
|
|
328
|
+
|
|
329
|
+
#OPTIKRON OBJECTS
|
|
330
|
+
IMAGE = "image"
|
|
331
|
+
WORKFLOW_EXECUTION_RESULT = "workflow_execution_result"
|
|
332
|
+
WORKFLOW_BATCH = "workflow_batch"
|
|
333
|
+
KORE_EXECUTION = "kore_execution"
|
|
334
|
+
WORKFLOW_BATCH_IMAGE = "workflow_batch"
|
|
335
|
+
WORKFLOW_REVIEW = "workflow_review"
|
|
336
|
+
|
|
337
|
+
class WhenToUseLogoEnum(str, Enum):
|
|
338
|
+
"""Logo when to use enum"""
|
|
339
|
+
ON_WHITE="on_white_full_color"
|
|
340
|
+
ON_BLACK="on_black_full_color"
|
|
341
|
+
ON_PRIMARY="on_primary_full_color"
|
|
342
|
+
ON_SECONDARY="on_secondary_full_color"
|
|
343
|
+
ON_WHITE_ONE_COLOR="on_white_one_color"
|
|
344
|
+
ON_BLACK_ONE_COLOR="on_black_one_color"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ods-types-py
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: Core types and enums for ODS (Optikka Design System) - Python implementation
|
|
5
|
+
Author-email: Optikka <dev@optikka.com>
|
|
6
|
+
License: PROPRIETARY
|
|
7
|
+
Project-URL: Homepage, https://github.com/optikka/ods
|
|
8
|
+
Project-URL: Repository, https://github.com/optikka/ods
|
|
9
|
+
Keywords: ods,types,enums,renderer,optikka
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
20
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
21
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
22
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
23
|
+
Requires-Dist: mypy>=1.5.0; extra == "dev"
|
|
24
|
+
|
|
25
|
+
# ods-types-py
|
|
26
|
+
|
|
27
|
+
Core types and enums for the ODS (Optikka Design System) renderer - Python implementation.
|
|
28
|
+
|
|
29
|
+
This is the Python equivalent of the `@optikka/ods-types` npm package, providing shared type definitions and enumerations used across ODS rendering services.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install ods-types-py
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from ods_types import (
|
|
41
|
+
Kind,
|
|
42
|
+
TargetKind,
|
|
43
|
+
AspectMode,
|
|
44
|
+
ScaleMode,
|
|
45
|
+
Box,
|
|
46
|
+
Target,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
# Use enums
|
|
50
|
+
kind = Kind.CANVAS
|
|
51
|
+
aspect = AspectMode.CONTAIN
|
|
52
|
+
|
|
53
|
+
# Use type definitions
|
|
54
|
+
box: Box = {"x": 0, "y": 0, "w": 100, "h": 100}
|
|
55
|
+
target: Target = {"kind": TargetKind.LAYER, "id": "layer-1"}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Package Contents
|
|
59
|
+
|
|
60
|
+
### Enums
|
|
61
|
+
- `Kind` - Canvas or layer types
|
|
62
|
+
- `TargetKind` - Target reference types (canvas, layer, guide, self)
|
|
63
|
+
- `AspectMode` - Aspect ratio modes (contain, cover, fitWidth, fitHeight)
|
|
64
|
+
- `ScaleMode` - Scaling modes for images and layers
|
|
65
|
+
- `AlignX`, `AlignY` - Alignment options
|
|
66
|
+
- `DropZoneMode` - Drop zone fit modes
|
|
67
|
+
- `StackDir`, `StackAlign` - Stack layout options
|
|
68
|
+
- `FadeKind`, `SlideKind` - Animation types
|
|
69
|
+
- `Easing` - Animation easing functions
|
|
70
|
+
- And more...
|
|
71
|
+
|
|
72
|
+
### Common Types
|
|
73
|
+
- `Box` - Rectangular region with x, y, w, h
|
|
74
|
+
- `Target` - Target reference with kind, id, and layerId
|
|
75
|
+
- `DrawImageParams` - Canvas drawImage parameters
|
|
76
|
+
|
|
77
|
+
## Development
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Install dev dependencies
|
|
81
|
+
pip install -e ".[dev]"
|
|
82
|
+
|
|
83
|
+
# Run tests
|
|
84
|
+
pytest
|
|
85
|
+
|
|
86
|
+
# Format code
|
|
87
|
+
black src/ tests/
|
|
88
|
+
|
|
89
|
+
# Lint
|
|
90
|
+
ruff check src/ tests/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
PROPRIETARY - Optikka
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
ods_types/__init__.py,sha256=ZkUoxgRQeLD-GJFztjJ2pT1LRgppLkMQ2PBE1J-0mTk,2006
|
|
2
|
+
ods_types/common.py,sha256=MvjX3vZU_uR1g0mnQE6JmQRQkjvGlcubC5NRhNjYMiA,1232
|
|
3
|
+
ods_types/enums.py,sha256=fRjF9jj0LrnLLBlVNYXRLXG1Yv6QGrE9Mgj3UdK8OsA,7527
|
|
4
|
+
ods_types_py-0.1.7.dist-info/METADATA,sha256=imRXkgiQGQguKWlHy4lamFay_w1WU1Knz_4V5JbOSwE,2454
|
|
5
|
+
ods_types_py-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
+
ods_types_py-0.1.7.dist-info/top_level.txt,sha256=wVLpbIj7pGhcfjoOwuBbEOF9eC528qMbG-XnooSerY4,10
|
|
7
|
+
ods_types_py-0.1.7.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ods_types
|