--- id: serpyco-rs version: "1.22.0" license: unclear license_treatment: permissive maintenance: active --- # serpyco-rs License: permissive · Maintenance: active · Downloads: 448.3K/mo ## What it is and what it does serpyco-rs is a serialization library for Python dataclasses that converts objects to and from built-in Python types (dict, list, etc.) or directly to/from bytes via JSON or MessagePack codecs. It analyzes dataclass field types at serializer creation time and supports a broad range of standard types—lists, tuples, optionals, enums, UUIDs, dates, decimals, unions, and nested dataclasses—along with validation of input data during deserialization. The library is implemented in Rust for speed and offers both a simple dict-based API (dump/load) and a codec-based API for direct bytes handling. It includes features like field aliasing, custom encoders/decoders, JSON Schema generation, and query-string deserialization with type coercion. The main use case is serializing objects for APIs, though it works for any object-to-type transformation task. Use it for: - Serialize dataclass instances to JSON for REST API responses without intermediate dict conversion. - Deserialize and validate incoming JSON payloads against a dataclass schema in a web framework. - Convert Python objects to MessagePack for efficient binary storage or network transmission. - Generate JSON Schema specifications from dataclass definitions for API documentation. - Deserialize query string parameters into typed dataclass instances with automatic coercion. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Serializes and deserializes Python dataclasses to/from dictionaries, JSON, or MessagePack, with built-in validation and support for nested types. Yes. serpyco-rs is actively maintained, has no known vulnerabilities, and offers strong performance for dataclass serialization. The MIT license is permissive. Install friction is moderate due to compiled wheels, but pre-built binaries are available for common platforms and Python versions 3.10–3.14. Choose it if you need fast, schema-validated serialization of dataclasses for APIs or data transformation. ## Install pip install serpyco-rs uv add serpyco-rs poetry add serpyco-rs ## Installing serpyco-rs Before you install: Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.14). Active maintenance with a recent release and no known vulnerabilities. Lightweight runtime dependencies (attributes-doc, typing-extensions) keep the footprint small. License in practice: MIT license (permissive); you can use this freely in commercial and private projects with minimal restrictions. Quickstart: import dataclasses import serpyco_rs @dataclasses.dataclass class Example: name: str num: int serializer = serpyco_rs.Serializer(Example) result = serializer.dump(Example(name="foo", num=2)) print(result) # {'name': 'foo', 'num': 2} Requires Python 3.10 or later. Verify before relying: - Whether custom encoder/decoder support covers all common field types needed for your schema. - Performance characteristics on deeply nested or very large dataclass hierarchies. - Compatibility with third-party dataclass libraries beyond standard library dataclasses. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 448.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dataclass serialization, python object to dict, json serializer dataclass, msgpack encoder python, schema validation serializer, fast dataclass serialization, typed data serialization, serialization, dataclass, rust-backed [View on SkillFed](https://skillfed.io/packages/serpyco-rs) · [View on PyPI](https://pypi.org/project/serpyco-rs/)