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}
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.
fixDefine all required methods (dump, load, etc.) for custom types.
ModuleNotFoundError: No module named 'serpyco'
Package not installed or installed in a different environment.
fixRun '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
Resources
No resource links recorded.