--- id: pyserde version: "0.32.0" license: MIT License Copyright (c) 2021 yukinarit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) license_treatment: permissive maintenance: active --- # pyserde — Yet another serialization library on top of dataclasses License: permissive · Maintenance: active · Downloads: 1.3M/mo ## What it is and what it does pyserde is a serialization library built on top of Python dataclasses that converts objects to and from multiple formats (JSON, YAML, TOML, MsgPack, Pickle, dict) using a decorator. You annotate your dataclass fields with PEP 484 type hints, and the library generates serialization and deserialization code automatically. It handles a wide range of types including primitives, standard containers (list, dict, set, tuple), Optional and Union types, datetime objects, UUID, Path, Decimal, Enum, and numpy types. The library focuses on simplicity: declare your class, decorate it, and call to_json() or from_json() to convert. It supports field-level customization (rename, alias, skip conditions, custom serializers), class-level attributes (case conversion, custom serializers), and advanced features like flattening, forward references, and generic types. Dependencies are minimal and well-established (beartype for runtime type checking, jinja2 for code generation, plum-dispatch for method dispatch). Use it for: - Convert API request/response dataclasses to JSON for REST endpoints or webhooks. - Load configuration files (YAML, TOML) into typed dataclass objects with validation. - Serialize domain objects to multiple formats (JSON for APIs, Pickle for caching) from a single definition. - Build data pipelines where objects move between services in different formats without manual conversion. - Validate and transform incoming JSON data into strongly-typed Python objects. - Store and retrieve structured data with automatic type checking during deserialization. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Serialize and deserialize Python dataclasses to and from JSON, YAML, TOML, MsgPack, Pickle, and dict formats using a decorator-based API. Yes. pyserde is actively maintained, has no known vulnerabilities, supports current Python versions (3.10–3.14), and offers a clean, decorator-based API for multi-format serialization of dataclasses. Install friction is low and the dependency set is reasonable. It is a solid choice for projects that need type-safe serialization without the overhead of heavier frameworks. ## Install pip install pyserde uv add pyserde poetry add pyserde ## Installing pyserde Before you install: Low friction install with a pure-Python wheel. Actively maintained with a release 4 days ago; repository shows 851 stars and recent activity. Six runtime dependencies (beartype, casefy, jinja2, plum-dispatch, typing-extensions, typing-inspect) are all standard utilities with minimal overhead. License in practice: MIT License permits unrestricted use, modification, and distribution in both open-source and commercial projects with only attribution required. Quickstart: pip install pyserde from pyserde import to_json, from_json @serde class Foo: i: int s: str obj = Foo(i=10, s='foo') json_str = to_json(obj) obj_restored = from_json(Foo, json_str) Requires Python 3.10 or later (3.10, 3.11, 3.12, 3.13, 3.14 supported). Verify before relying: - Performance characteristics compared to other serialization libraries in typical workloads. - Maturity and stability of experimental SQLAlchemy integration. - Whether custom (de)serializers handle all edge cases users encounter in production. ## Package facts - License: MIT License Copyright (c) 2021 yukinarit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags dataclass serialization, json serialization library, python serialization, serialize deserialize dataclass, yaml json conversion, type-safe serialization, multi-format serialization, serialization, dataclass, type-safe [View on SkillFed](https://skillfed.io/packages/pyserde) · [View on PyPI](https://pypi.org/project/pyserde/)