Skip to main content

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 types
  • ReviewStatusEnum - Review status for workflows
  • ImageTypeEnum - Image type classification
  • BatchTypeEnum, BatchStatusEnum - Workflow batch types
  • ExecutionStatusEnum - Kore execution status

Models

Template System

  • TemplateRegistry - Template metadata and configuration
  • TemplateInput - Template input with design data
  • Asset, Logo, Text - Design data elements
  • InputParameters - Template input specifications
  • CanvasGlobals - Canvas configuration (presets, guides, grids)

Rendering

  • RenderRun - Batch rendering operations
  • TemplateInputJob - Target input job processing

Images & Workflows

  • Image - Image entity
  • WorkflowExecutionResult - Workflow execution results
  • WorkflowBatch - Workflow batch entity
  • KoreExecution - Kore execution entity

Supporting Models

  • GuideDoc - Canvas guide definitions
  • FlexPreset - Canvas aspect ratio presets
  • AssetSpecs, LogoSpecs, TextSpecs - Input specifications

Features

Type Safety: Full Pydantic validation with Python type hints ✅ Compatible: Matches TypeScript models in @optikka/ods-modelsValidated: Runtime validation with Pydantic v2 ✅ Documented: Comprehensive docstrings and examples

Dependencies

  • pydantic>=2.6.1,<3.0.0
  • ods-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 enums
  • optikka-design-data-layer - AWS utilities and clients

License

PROPRIETARY - Optikka

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ods_models_py-0.1.23.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ods_models_py-0.1.23-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file ods_models_py-0.1.23.tar.gz.

File metadata

  • Download URL: ods_models_py-0.1.23.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ods_models_py-0.1.23.tar.gz
Algorithm Hash digest
SHA256 80808350b0f0fb2d9b11acf0127dc472e03d670c17eb682a00997ad0da6399f2
MD5 1638b3ee55ad465faa9541a7bce23001
BLAKE2b-256 bfbc9d3f1fed8716e9a2999113bc97df9b12e8986471c503480e3be2fcc42f0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ods_models_py-0.1.23.tar.gz:

Publisher: python-publish.yml on OptikkaCorp/design-models-package

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ods_models_py-0.1.23-py3-none-any.whl.

File metadata

  • Download URL: ods_models_py-0.1.23-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ods_models_py-0.1.23-py3-none-any.whl
Algorithm Hash digest
SHA256 d53f75f3c188516b00357758ed8ee814fe96c3305a981d7befcc3e3711ee7a27
MD5 fe06c4a45a87bfa97d40647d7dd06b0d
BLAKE2b-256 d26024dbb716ae39b982e8269a6c01239a67713cc0700f06c2ce92dad75a35d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ods_models_py-0.1.23-py3-none-any.whl:

Publisher: python-publish.yml on OptikkaCorp/design-models-package

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page