A comprehensive Python library for serializing and deserializing Python objects to and from JSON (dictionaries) with minimal code changes required.
81
A Python library for managing user profiles with JSON serialization support. The library provides functionality to create, serialize, and deserialize user profile objects using Python's dataclass features.
@generates
from dataclasses import dataclass
from typing import Dict, Any
@dataclass
class UserProfile:
"""Represents a user profile with basic information."""
name: str
age: int
email: str
is_active: bool = True
def serialize_profile(profile: UserProfile) -> Dict[str, Any]:
"""
Serialize a UserProfile instance to a dictionary.
Args:
profile: The UserProfile instance to serialize
Returns:
A dictionary representation of the profile
"""
pass
def deserialize_profile(data: Dict[str, Any]) -> UserProfile:
"""
Deserialize a dictionary to a UserProfile instance.
Args:
data: Dictionary containing profile data
Returns:
A UserProfile instance
"""
passProvides JSON serialization and deserialization support for Python dataclasses.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-jsonsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10