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.0b5.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for flytekitplugins_pydantic-1.14.0b5.tar.gz
Algorithm Hash digest
SHA256 674a1bb0f52b9158f369324dac34ceb05573d36d9eaf466c6b55d342b3deb58c
MD5 8303fea90f6cb7b632b1874eb90382e5
BLAKE2b-256 9f48520528c17feb76110e0ba27fafb58590aa13225e01f9b0719fc6b7a344c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flytekitplugins_pydantic-1.14.0b5-py3-none-any.whl
Algorithm Hash digest
SHA256 deedd5fa0380f9d6991596a6f66e0a27336cf160df890b1411019e50782952cb
MD5 ef4b23b4c45ae473d84b2b56eaa26050
BLAKE2b-256 278fc44c6908ac382bde445fde3aab491e60af720eec6b86248b9d9bcc31fd0c

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