Skip to main content

Convert unstructured data into type-safe dataclasses.

Project description

from dataclasses import dataclass, field
from flutter import checked, check_type
from typing import List

class Node:
    line: int

class Parent(Node):
    children: List[Node] = field(default_factory=list)

assert check_type(Parent, {
    'line': 0,
    'children': [{'line': 1}]
}) == Parent(line=0, children=[Node(1)])

assert check_type(Parent, {
    'line': 10
}) == Parent(line=10, children=[])

Project details

Release history Release notifications

This version


Download files

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

Files for flutter, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size flutter-0.1-py3-none-any.whl (12.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size flutter-0.1.tar.gz (8.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page