SIMNet/simnet/models/base.py
洛水居室 73410f136e
Add APIModel
2023-05-02 01:02:53 +08:00

17 lines
394 B
Python

from pydantic import BaseModel
try:
import ujson as jsonlib
except ImportError:
import json as jsonlib
class APIModel(BaseModel):
"""A Pydantic BaseModel class used for modeling JSON data returned by an API."""
class Config:
"""A nested class defining configuration options for the APIModel."""
json_dumps = jsonlib.dumps
json_loads = jsonlib.loads