from dataclasses import dataclass
from jsondataclass import from_json, DataClassMapper


@dataclass
class User:
    id: int
    name: str


json_str = '{"id": 1, "name": "<NAME>"}'

mapper = DataClassMapper()
user = mapper.from_json(json_str, User)
print(user)
# User(id=1, name='<NAME>')

# or
user = from_json(json_str, User)
print(user)
# User(id=1, name='<NAME>')

from dataclasses import dataclass
from jsondataclass import from_json, DataClassMapper


@dataclass
class User:
    id: int
    name: str


json_str = '{"id": 1, "name": "<NAME>"}'

mapper = DataClassMapper()
user = mapper.from_json(json_str, User)
print(user)
# User(id=1, name='<NAME>')

# or
user = from_json(json_str, User)
print(user)
# User(id=1, name='<NAME>')

# User(id=1, name='<NAME>') # or # User(id=1, name='<NAME>')