Pydantic data models for ODS (Optikka Design System) - Python implementation
Project description
ods-models-py
Pydantic data models for the ODS (Optikka Design System) - Python implementation.
This is the Python equivalent of the @optikka/ods-models npm package, providing Pydantic models for templates, inputs, render runs, and related entities.
Installation
pip install ods-models-py
Usage
from ods_models import (
TemplateRegistry,
TemplateInput,
Asset,
Logo,
Text,
ImageMimeType,
RenderRun,
RenderRunStatus,
)
# Create an asset
asset = Asset(
width=1920,
height=1080,
mime_type=ImageMimeType.PNG,
parsing_label="hero_image",
s3Location={"bucket": "my-bucket", "key": "image.png"},
)
# Create template input design data
from ods_models import TemplateInputDesignData
design_data = TemplateInputDesignData(
assets=[asset],
logos=[],
texts=[],
extra_data={},
)
# Use with validation
template_input = TemplateInput(
id="123",
template_registry_id="template-456",
inputs=design_data,
created_by="user@example.com",
updated_by="user@example.com",
account_id="account-789",
studio_id="studio-101",
)
Package Contents
Base Enums
ImageMimeType- Supported image MIME typesReviewStatusEnum- Review status for workflowsImageTypeEnum- Image type classificationBatchTypeEnum,BatchStatusEnum- Workflow batch typesExecutionStatusEnum- Kore execution status
Models
Template System
TemplateRegistry- Template metadata and configurationTemplateInput- Template input with design dataAsset,Logo,Text- Design data elementsInputParameters- Template input specificationsCanvasGlobals- Canvas configuration (presets, guides, grids)
Rendering
RenderRun- Batch rendering operationsTargetInputJob- Target input job processing
Images & Workflows
Image- Image entityWorkflowExecutionResult- Workflow execution resultsWorkflowBatch- Workflow batch entityKoreExecution- Kore execution entity
Supporting Models
GuideDoc- Canvas guide definitionsFlexPreset- Canvas aspect ratio presetsAssetSpecs,LogoSpecs,TextSpecs- Input specifications
Features
✅ Type Safety: Full Pydantic validation with Python type hints
✅ Compatible: Matches TypeScript models in @optikka/ods-models
✅ Validated: Runtime validation with Pydantic v2
✅ Documented: Comprehensive docstrings and examples
Dependencies
pydantic>=2.6.1,<3.0.0ods-types-py>=0.1.0,<1.0.0
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/ tests/
# Lint
ruff check src/ tests/
# Type check
mypy src/
Related Packages
ods-types-py- Core types and enumsoptikka-design-data-layer- AWS utilities and clients
License
PROPRIETARY - Optikka
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ods_models_py-0.1.6.tar.gz.
File metadata
- Download URL: ods_models_py-0.1.6.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adf3e856754d21754a2956226e4d17761cd179c79805b6d18c3c5ddaed56ac81
|
|
| MD5 |
68b742cc4b9996f35acae1df23a66ec4
|
|
| BLAKE2b-256 |
bec074efa1c9d0b2169bf04dd8e060b3b2b31ab5a15254aa4176f03b265bede6
|
Provenance
The following attestation bundles were made for ods_models_py-0.1.6.tar.gz:
Publisher:
python-publish.yml on OptikkaCorp/design-models-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ods_models_py-0.1.6.tar.gz -
Subject digest:
adf3e856754d21754a2956226e4d17761cd179c79805b6d18c3c5ddaed56ac81 - Sigstore transparency entry: 772667778
- Sigstore integration time:
-
Permalink:
OptikkaCorp/design-models-package@6e327204a6eccc1de76c0968bb4d96dbdc3d91db -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OptikkaCorp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6e327204a6eccc1de76c0968bb4d96dbdc3d91db -
Trigger Event:
push
-
Statement type:
File details
Details for the file ods_models_py-0.1.6-py3-none-any.whl.
File metadata
- Download URL: ods_models_py-0.1.6-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
395b06f9e396dada70757be524a538d7346be36096858e70187ce1709efad388
|
|
| MD5 |
45946f1555b077af3dd43d8f01adc726
|
|
| BLAKE2b-256 |
0bf95de5b7dd8cb837a37e5a23b095e01e5fb6bc81e2902917a1f5dc386a1d8f
|
Provenance
The following attestation bundles were made for ods_models_py-0.1.6-py3-none-any.whl:
Publisher:
python-publish.yml on OptikkaCorp/design-models-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ods_models_py-0.1.6-py3-none-any.whl -
Subject digest:
395b06f9e396dada70757be524a538d7346be36096858e70187ce1709efad388 - Sigstore transparency entry: 772667780
- Sigstore integration time:
-
Permalink:
OptikkaCorp/design-models-package@6e327204a6eccc1de76c0968bb4d96dbdc3d91db -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OptikkaCorp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6e327204a6eccc1de76c0968bb4d96dbdc3d91db -
Trigger Event:
push
-
Statement type: