Skip to main content

Plugin adding type support for Pydantic models

Project description

Flytekit Pydantic Plugin

Warning

This plugin is deprecated and will be removed in the future.

Please directly install pydantic and use BaseModel in your Flyte tasks.

Introduction

Pydantic is a data validation and settings management library that uses Python type annotations to enforce type hints at runtime and provide user-friendly errors when data is invalid. Pydantic models are classes that inherit from pydantic.BaseModel and are used to define the structure and validation of data using Python type annotations.

The plugin adds type support for pydantic models.

To install the plugin, run the following command:

pip install flytekitplugins-pydantic

Type Example

from pydantic.v1 import BaseModel


class TrainConfig(BaseModel):
    lr: float = 1e-3
    batch_size: int = 32
    files: List[FlyteFile]
    directories: List[FlyteDirectory]

@task
def train(cfg: TrainConfig):
    ...

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

flytekitplugins_pydantic-1.14.0b4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file flytekitplugins_pydantic-1.14.0b4.tar.gz.

File metadata

File hashes

Hashes for flytekitplugins_pydantic-1.14.0b4.tar.gz
Algorithm Hash digest
SHA256 b744edcfed1d5d0015b525c132600eb10ae5b147c1027ee1fcc00c2d7900824f
MD5 b5bc42a01f189caf156cfbfde02c3177
BLAKE2b-256 d09d757575268cfde1176778640aacb6ec0d5ab185112b301e437251b68dad78

See more details on using hashes here.

File details

Details for the file flytekitplugins_pydantic-1.14.0b4-py3-none-any.whl.

File metadata

File hashes

Hashes for flytekitplugins_pydantic-1.14.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 1e2b50fe8f4772fc2461389e9d66a5e97a0d459fef68aa8ca2f61c77d7b61ae1
MD5 a56d2ba29e0507376b93a2bc825ddf3e
BLAKE2b-256 bd185565f0c12b2a23582af1b9af5954dde1c84829439509a0907b43f8289e86

See more details on using hashes here.

Supported by

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