Skip to main content

Ordered dataclass serializer mixin for sloted dataclasses

Project description

Serious Serializers

tests

Simple class mixin to add YAML serialization and deserialization to dataclass objects that use slots.

Examples

To add serialization to dataclass object:

from serious_serializers import SlotsSerializer

@dataclass(slots=True)
class Data(SlotsSerializer):
    n: int
    data: List[float]

To represent the class tag as !Data:

from serious_serializers import SlotsSerializer

@SlotsSerializer.show_tag
@dataclass(slots=True)
class Data(SlotsSerializer):
    n: int
    data: List[float]

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

serious_serializers-0.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

serious_serializers-0.1.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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