Registry / devops / serpyco

serpyco

JSON →
library1.3.13pypypi✓ verified 84d ago

Fast serialization of dataclasses using Cython. Current version 1.3.13. Release cadence is low, with infrequent updates.

pip install serpyco
INSTALL
IMPORT
SIG · SERPYCO
S
serpyco
devopspythonv1.3.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Serializer
from serpyco import Serializer
from serpyco import Serpyco
Wrong class name used by some tutorials
dump
from serpyco import dump

Basic usage: define a dataclass, create a Serializer, and dump/load.

from dataclasses import dataclass import serpyco @dataclass class User: name: str age: int serializer = serpyco.Serializer(User) data = serializer.dump(User(name='Alice', age=30)) print(data) # Expected: {'name': 'Alice', 'age': 30}
Debug
Known issues
gotchaSerpyco does not support classes with __slots__ or non-dataclass types. Attempting to serialize a regular class will raise TypeError.
fix
Ensure your class is a dataclass (decorated with @dataclass).
affects: all
breakingIn version 0.2.0, the API changed from using Serpyco class to Serializer class. Old code using serpyco.Serpyco will break.
fix
Change 'from serpyco import Serpyco' to 'from serpyco import Serializer'.
affects: <=0.1.x
Errors
Common errors & fixes
TypeError: Can't instantiate abstract class Serializer with abstract methods...
Subclassing Serializer without implementing all abstract methods from a custom type handler.
fix
Define all required methods (dump, load, etc.) for custom types.
ModuleNotFoundError: No module named 'serpyco'
Package not installed or installed in a different environment.
fix
Run 'pip install serpyco' in the correct environment.
Upgrade
Version history
1.3.13latest on PyPI · released May 4, 2024
Audit
Dependencies
cythonoptionalCompilation dependency; not needed at runtime if pre-compiled
orjsonoptionalOptional dependency for fast JSON serialization
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources

No resource links recorded.

serpyco — pip install serpyco · libregistry