ods-models-py 0.1.0__tar.gz

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.
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: ods-models-py
3
+ Version: 0.1.0
4
+ Summary: Pydantic data models 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,models,pydantic,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
+ Requires-Dist: pydantic<3.0.0,>=2.6.1
19
+ Requires-Dist: ods-types-py<1.0.0,>=0.1.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
22
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
23
+ Requires-Dist: black>=23.0.0; extra == "dev"
24
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
25
+ Requires-Dist: mypy>=1.5.0; extra == "dev"
26
+
27
+ # ods-models-py
28
+
29
+ Pydantic data models for the ODS (Optikka Design System) - Python implementation.
30
+
31
+ This is the Python equivalent of the `@optikka/ods-models` npm package, providing Pydantic models for templates, inputs, render runs, and related entities.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install ods-models-py
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```python
42
+ from ods_models import (
43
+ TemplateRegistry,
44
+ TemplateInput,
45
+ Asset,
46
+ Logo,
47
+ Text,
48
+ ImageMimeType,
49
+ RenderRun,
50
+ RenderRunStatus,
51
+ )
52
+
53
+ # Create an asset
54
+ asset = Asset(
55
+ width=1920,
56
+ height=1080,
57
+ mime_type=ImageMimeType.PNG,
58
+ parsing_label="hero_image",
59
+ s3Location={"bucket": "my-bucket", "key": "image.png"},
60
+ )
61
+
62
+ # Create template input design data
63
+ from ods_models import TemplateInputDesignData
64
+
65
+ design_data = TemplateInputDesignData(
66
+ assets=[asset],
67
+ logos=[],
68
+ texts=[],
69
+ extra_data={},
70
+ )
71
+
72
+ # Use with validation
73
+ template_input = TemplateInput(
74
+ id="123",
75
+ template_registry_id="template-456",
76
+ inputs=design_data,
77
+ created_by="user@example.com",
78
+ updated_by="user@example.com",
79
+ account_id="account-789",
80
+ studio_id="studio-101",
81
+ )
82
+ ```
83
+
84
+ ## Package Contents
85
+
86
+ ### Base Enums
87
+ - `ImageMimeType` - Supported image MIME types
88
+ - `ReviewStatusEnum` - Review status for workflows
89
+ - `ImageTypeEnum` - Image type classification
90
+ - `BatchTypeEnum`, `BatchStatusEnum` - Workflow batch types
91
+ - `ExecutionStatusEnum` - Kore execution status
92
+
93
+ ### Models
94
+
95
+ #### Template System
96
+ - `TemplateRegistry` - Template metadata and configuration
97
+ - `TemplateInput` - Template input with design data
98
+ - `Asset`, `Logo`, `Text` - Design data elements
99
+ - `InputParameters` - Template input specifications
100
+ - `CanvasGlobals` - Canvas configuration (presets, guides, grids)
101
+
102
+ #### Rendering
103
+ - `RenderRun` - Batch rendering operations
104
+ - `TargetInputJob` - Target input job processing
105
+
106
+ #### Images & Workflows
107
+ - `Image` - Image entity
108
+ - `WorkflowExecutionResult` - Workflow execution results
109
+ - `WorkflowBatch` - Workflow batch entity
110
+ - `KoreExecution` - Kore execution entity
111
+
112
+ #### Supporting Models
113
+ - `GuideDoc` - Canvas guide definitions
114
+ - `FlexPreset` - Canvas aspect ratio presets
115
+ - `AssetSpecs`, `LogoSpecs`, `TextSpecs` - Input specifications
116
+
117
+ ## Features
118
+
119
+ ✅ **Type Safety**: Full Pydantic validation with Python type hints
120
+ ✅ **Compatible**: Matches TypeScript models in `@optikka/ods-models`
121
+ ✅ **Validated**: Runtime validation with Pydantic v2
122
+ ✅ **Documented**: Comprehensive docstrings and examples
123
+
124
+ ## Dependencies
125
+
126
+ - `pydantic>=2.6.1,<3.0.0`
127
+ - `ods-types-py>=0.1.0,<1.0.0`
128
+
129
+ ## Development
130
+
131
+ ```bash
132
+ # Install dev dependencies
133
+ pip install -e ".[dev]"
134
+
135
+ # Run tests
136
+ pytest
137
+
138
+ # Format code
139
+ black src/ tests/
140
+
141
+ # Lint
142
+ ruff check src/ tests/
143
+
144
+ # Type check
145
+ mypy src/
146
+ ```
147
+
148
+ ## Related Packages
149
+
150
+ - `ods-types-py` - Core types and enums
151
+ - `optikka-design-data-layer` - AWS utilities and clients
152
+
153
+ ## License
154
+
155
+ PROPRIETARY - Optikka
@@ -0,0 +1,129 @@
1
+ # ods-models-py
2
+
3
+ Pydantic data models for the ODS (Optikka Design System) - Python implementation.
4
+
5
+ This is the Python equivalent of the `@optikka/ods-models` npm package, providing Pydantic models for templates, inputs, render runs, and related entities.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install ods-models-py
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```python
16
+ from ods_models import (
17
+ TemplateRegistry,
18
+ TemplateInput,
19
+ Asset,
20
+ Logo,
21
+ Text,
22
+ ImageMimeType,
23
+ RenderRun,
24
+ RenderRunStatus,
25
+ )
26
+
27
+ # Create an asset
28
+ asset = Asset(
29
+ width=1920,
30
+ height=1080,
31
+ mime_type=ImageMimeType.PNG,
32
+ parsing_label="hero_image",
33
+ s3Location={"bucket": "my-bucket", "key": "image.png"},
34
+ )
35
+
36
+ # Create template input design data
37
+ from ods_models import TemplateInputDesignData
38
+
39
+ design_data = TemplateInputDesignData(
40
+ assets=[asset],
41
+ logos=[],
42
+ texts=[],
43
+ extra_data={},
44
+ )
45
+
46
+ # Use with validation
47
+ template_input = TemplateInput(
48
+ id="123",
49
+ template_registry_id="template-456",
50
+ inputs=design_data,
51
+ created_by="user@example.com",
52
+ updated_by="user@example.com",
53
+ account_id="account-789",
54
+ studio_id="studio-101",
55
+ )
56
+ ```
57
+
58
+ ## Package Contents
59
+
60
+ ### Base Enums
61
+ - `ImageMimeType` - Supported image MIME types
62
+ - `ReviewStatusEnum` - Review status for workflows
63
+ - `ImageTypeEnum` - Image type classification
64
+ - `BatchTypeEnum`, `BatchStatusEnum` - Workflow batch types
65
+ - `ExecutionStatusEnum` - Kore execution status
66
+
67
+ ### Models
68
+
69
+ #### Template System
70
+ - `TemplateRegistry` - Template metadata and configuration
71
+ - `TemplateInput` - Template input with design data
72
+ - `Asset`, `Logo`, `Text` - Design data elements
73
+ - `InputParameters` - Template input specifications
74
+ - `CanvasGlobals` - Canvas configuration (presets, guides, grids)
75
+
76
+ #### Rendering
77
+ - `RenderRun` - Batch rendering operations
78
+ - `TargetInputJob` - Target input job processing
79
+
80
+ #### Images & Workflows
81
+ - `Image` - Image entity
82
+ - `WorkflowExecutionResult` - Workflow execution results
83
+ - `WorkflowBatch` - Workflow batch entity
84
+ - `KoreExecution` - Kore execution entity
85
+
86
+ #### Supporting Models
87
+ - `GuideDoc` - Canvas guide definitions
88
+ - `FlexPreset` - Canvas aspect ratio presets
89
+ - `AssetSpecs`, `LogoSpecs`, `TextSpecs` - Input specifications
90
+
91
+ ## Features
92
+
93
+ ✅ **Type Safety**: Full Pydantic validation with Python type hints
94
+ ✅ **Compatible**: Matches TypeScript models in `@optikka/ods-models`
95
+ ✅ **Validated**: Runtime validation with Pydantic v2
96
+ ✅ **Documented**: Comprehensive docstrings and examples
97
+
98
+ ## Dependencies
99
+
100
+ - `pydantic>=2.6.1,<3.0.0`
101
+ - `ods-types-py>=0.1.0,<1.0.0`
102
+
103
+ ## Development
104
+
105
+ ```bash
106
+ # Install dev dependencies
107
+ pip install -e ".[dev]"
108
+
109
+ # Run tests
110
+ pytest
111
+
112
+ # Format code
113
+ black src/ tests/
114
+
115
+ # Lint
116
+ ruff check src/ tests/
117
+
118
+ # Type check
119
+ mypy src/
120
+ ```
121
+
122
+ ## Related Packages
123
+
124
+ - `ods-types-py` - Core types and enums
125
+ - `optikka-design-data-layer` - AWS utilities and clients
126
+
127
+ ## License
128
+
129
+ PROPRIETARY - Optikka
@@ -0,0 +1,61 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ods-models-py"
7
+ version = "0.1.0"
8
+ description = "Pydantic data models for ODS (Optikka Design System) - Python implementation"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = {text = "PROPRIETARY"}
12
+ authors = [
13
+ {name = "Optikka", email = "dev@optikka.com"}
14
+ ]
15
+ keywords = ["ods", "models", "pydantic", "renderer", "optikka"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ ]
24
+
25
+ dependencies = [
26
+ "pydantic>=2.6.1,<3.0.0",
27
+ "ods-types-py>=0.1.0,<1.0.0",
28
+ ]
29
+
30
+ [project.optional-dependencies]
31
+ dev = [
32
+ "pytest>=7.4.0",
33
+ "pytest-cov>=4.1.0",
34
+ "black>=23.0.0",
35
+ "ruff>=0.1.0",
36
+ "mypy>=1.5.0",
37
+ ]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/optikka/ods"
41
+ Repository = "https://github.com/optikka/ods"
42
+
43
+ [tool.setuptools]
44
+ package-dir = {"" = "src"}
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.black]
50
+ line-length = 100
51
+ target-version = ['py311']
52
+
53
+ [tool.ruff]
54
+ line-length = 100
55
+ target-version = "py311"
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = ["tests"]
59
+ python_files = ["test_*.py"]
60
+ python_classes = ["Test*"]
61
+ python_functions = ["test_*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,195 @@
1
+ """
2
+ ODS Models - Python Implementation
3
+ Pydantic data models for the ODS (Optikka Design System).
4
+ Python equivalent of @optikka/ods-models npm package.
5
+ """
6
+
7
+ __version__ = "0.1.0"
8
+
9
+ # Re-export base enums
10
+ from ods_models.base import (
11
+ ImageMimeType,
12
+ ReviewStatusEnum,
13
+ ImageTypeEnum,
14
+ BatchTypeEnum,
15
+ BatchStatusEnum,
16
+ ExecutionStatusEnum,
17
+ DesignDataInputTypes,
18
+ HTTPMethod,
19
+ )
20
+
21
+ # Re-export guides
22
+ from ods_models.guides import GuideDoc
23
+
24
+ # Re-export canvas globals
25
+ from ods_models.canvas_globals import (
26
+ CanvasGuideKind,
27
+ CanvasGridKind,
28
+ BentoAxis,
29
+ FlexPreset,
30
+ CanvasGuides,
31
+ CanvasGridBase,
32
+ CanvasSimpleGridDef,
33
+ CanvasBentoGridDef,
34
+ CanvasBentoNode,
35
+ CanvasGridDef,
36
+ CanvasGlobals,
37
+ )
38
+
39
+ # Re-export input parameters
40
+ from ods_models.input_parameters import (
41
+ TextTypeEnum,
42
+ AssetSpecs,
43
+ LogoSpecs,
44
+ TextSpecs,
45
+ InputParameters,
46
+ InputParametersPartialForCreate,
47
+ )
48
+
49
+ # Re-export template input
50
+ from ods_models.template_input import (
51
+ Asset,
52
+ Logo,
53
+ Text,
54
+ TemplateInputDesignData,
55
+ TemplateInput,
56
+ TemplateInputWithoutId,
57
+ TemplateInputForCreate,
58
+ )
59
+
60
+ # Re-export template registry
61
+ from ods_models.template_registry import (
62
+ TemplateRegistry,
63
+ TemplateRegistryWithoutId,
64
+ TemplateRegistryInputForCreate,
65
+ ODSScript,
66
+ TemplateRecipe,
67
+ )
68
+
69
+ # Re-export render run
70
+ from ods_models.render_run import (
71
+ RenderRunStatus,
72
+ RenderRunQueueEventType,
73
+ RenderRun,
74
+ RenderRunInputForCreate,
75
+ RenderRunWithoutId,
76
+ StartRenderRunFromTargetInputJobInput,
77
+ TargetInputJobImage,
78
+ Progress,
79
+ Mapping,
80
+ TargetInputJobResult,
81
+ TargetInputJobStatus,
82
+ TargetInputJob,
83
+ )
84
+
85
+ # Re-export image and workflow models
86
+ from ods_models.image import (
87
+ Image,
88
+ WorkflowExecutionResult,
89
+ WorkflowBatch,
90
+ KoreExecution,
91
+ ResizeParams,
92
+ )
93
+
94
+ # Re-export brand models
95
+ from ods_models.brand import (
96
+ RGB,
97
+ HSL,
98
+ HSV,
99
+ CMYK,
100
+ Color,
101
+ ColorPalette,
102
+ BrandRule,
103
+ ImageQueryHint,
104
+ EntityAttributeSpec,
105
+ BrandRegistry,
106
+ BrandRegistryWithoutId,
107
+ BrandRegistryInputForCreate,
108
+ Brand,
109
+ BrandWithoutId,
110
+ BrandInputForCreate,
111
+ BrandInputWithoutId,
112
+ )
113
+
114
+ __all__ = [
115
+ # Base enums
116
+ "ImageMimeType",
117
+ "ReviewStatusEnum",
118
+ "ImageTypeEnum",
119
+ "BatchTypeEnum",
120
+ "BatchStatusEnum",
121
+ "ExecutionStatusEnum",
122
+ "DesignDataInputTypes",
123
+ "HTTPMethod",
124
+ # Guides
125
+ "GuideDoc",
126
+ # Canvas globals
127
+ "CanvasGuideKind",
128
+ "CanvasGridKind",
129
+ "BentoAxis",
130
+ "FlexPreset",
131
+ "CanvasGuides",
132
+ "CanvasGridBase",
133
+ "CanvasSimpleGridDef",
134
+ "CanvasBentoGridDef",
135
+ "CanvasBentoNode",
136
+ "CanvasGridDef",
137
+ "CanvasGlobals",
138
+ # Input parameters
139
+ "TextTypeEnum",
140
+ "AssetSpecs",
141
+ "LogoSpecs",
142
+ "TextSpecs",
143
+ "InputParameters",
144
+ "InputParametersPartialForCreate",
145
+ # Template input
146
+ "Asset",
147
+ "Logo",
148
+ "Text",
149
+ "TemplateInputDesignData",
150
+ "TemplateInput",
151
+ "TemplateInputWithoutId",
152
+ "TemplateInputForCreate",
153
+ # Template registry
154
+ "TemplateRegistry",
155
+ "TemplateRegistryWithoutId",
156
+ "TemplateRegistryInputForCreate",
157
+ "ODSScript",
158
+ "TemplateRecipe",
159
+ # Render run
160
+ "RenderRunStatus",
161
+ "RenderRunQueueEventType",
162
+ "RenderRun",
163
+ "RenderRunInputForCreate",
164
+ "RenderRunWithoutId",
165
+ "StartRenderRunFromTargetInputJobInput",
166
+ "TargetInputJobImage",
167
+ "Progress",
168
+ "Mapping",
169
+ "TargetInputJobResult",
170
+ "TargetInputJobStatus",
171
+ "TargetInputJob",
172
+ # Image and workflow
173
+ "Image",
174
+ "WorkflowExecutionResult",
175
+ "WorkflowBatch",
176
+ "KoreExecution",
177
+ "ResizeParams",
178
+ # Brand models
179
+ "RGB",
180
+ "HSL",
181
+ "HSV",
182
+ "CMYK",
183
+ "Color",
184
+ "ColorPalette",
185
+ "BrandRule",
186
+ "ImageQueryHint",
187
+ "EntityAttributeSpec",
188
+ "BrandRegistry",
189
+ "BrandRegistryWithoutId",
190
+ "BrandRegistryInputForCreate",
191
+ "Brand",
192
+ "BrandWithoutId",
193
+ "BrandInputForCreate",
194
+ "BrandInputWithoutId",
195
+ ]
@@ -0,0 +1,77 @@
1
+ """
2
+ ODS Models - Base Types
3
+ Base enums and types used across ODS models.
4
+ Python equivalent of @optikka/ods-models/base
5
+ """
6
+
7
+ from enum import Enum
8
+
9
+
10
+ class ImageMimeType(str, Enum):
11
+ """
12
+ Image MIME types supported by ODS.
13
+ Matches design-data-microservices Python models.
14
+ """
15
+ PNG = "image/png"
16
+ JPEG = "image/jpeg"
17
+ GIF = "image/gif"
18
+ WEBP = "image/webp"
19
+ SVG = "image/svg+xml"
20
+
21
+
22
+ class ReviewStatusEnum(str, Enum):
23
+ """Review status for workflow execution results"""
24
+ APPROVED = "APPROVED"
25
+ PENDING = "PENDING"
26
+ REJECTED = "REJECTED"
27
+
28
+
29
+ class ImageTypeEnum(str, Enum):
30
+ """Image type classification"""
31
+ ORIGINAL = "ORIGINAL"
32
+ WORK_IN_PROGRESS = "WORK_IN_PROGRESS"
33
+ LEAF = "LEAF"
34
+ DEBUG = "DEBUG"
35
+
36
+
37
+ class BatchTypeEnum(str, Enum):
38
+ """Workflow batch type"""
39
+ UPLOAD = "UPLOAD"
40
+ DOWNLOAD = "DOWNLOAD"
41
+ SHARED = "SHARED"
42
+ WORKFLOW_RUN = "WORKFLOW_RUN"
43
+
44
+
45
+ class BatchStatusEnum(str, Enum):
46
+ """Workflow batch status"""
47
+ QUEUED = "QUEUED"
48
+ RUNNING = "RUNNING"
49
+ COMPLETED = "COMPLETED"
50
+ FAILED = "FAILED"
51
+
52
+
53
+ class ExecutionStatusEnum(str, Enum):
54
+ """Kore execution status"""
55
+ QUEUED = "QUEUED"
56
+ RUNNING = "RUNNING"
57
+ COMPLETED = "COMPLETED"
58
+ FAILED = "FAILED"
59
+
60
+
61
+ class DesignDataInputTypes(str, Enum):
62
+ """Design data input types"""
63
+ ASSETS = "assets"
64
+ LOGOS = "logos"
65
+ TEXTS = "texts"
66
+ EXTRA_DATA = "extra_data"
67
+
68
+
69
+ class HTTPMethod(str, Enum):
70
+ """HTTP method"""
71
+ GET = "GET"
72
+ POST = "POST"
73
+ PUT = "PUT"
74
+ PATCH = "PATCH"
75
+ DELETE = "DELETE"
76
+ OPTIONS = "OPTIONS"
77
+ HEAD = "HEAD"