or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-1/

User Profile Manager

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.

Capabilities

Profile Creation and Serialization

  • Creates a UserProfile dataclass with fields: name (str), age (int), email (str), and is_active (bool), then serializes it to a dictionary @test
  • Creates a UserProfile with default values (is_active defaults to True) and serializes to dictionary @test

Profile Deserialization

  • Deserializes a dictionary containing user data (name, age, email, is_active) into a UserProfile dataclass instance @test
  • Deserializes a dictionary with missing optional field (is_active) using the default value @test

Implementation

@generates

API

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
    """
    pass

Dependencies { .dependencies }

jsons { .dependency }

Provides JSON serialization and deserialization support for Python dataclasses.

@satisfied-by