Typedmarshal
(WIP) Smart (un)marshaller between Python object and JSON inspired by Golang's unmarshaller.
Install / Use
/learn @puhitaku/TypedmarshalREADME
TypedMarshal
Strongly typed (un)marshaller between Python object and JSON inspired by Golang's "encode/json" library.
Short example
Here is a pitch for TypedMarshal.
Let there be a JSON model definition: ::
from typedmarshal import MarshalModel
class SampleModel(MarshalModel):
name: str = None
age: int = None
hobbies: List[str] = []
Then unmarshal JSON: ::
js_str = '''
{
"name": "Hatsune Miku",
"age": 16,
"hobbies": ["Sing a song", "Dance to music", "Eat negi"]
}
'''
js_obj = SampleModel()
js_obj.load_json(js_str)
Now defined attributes are available to use: ::
>>> js_obj.name
'Hatsune Miku'
>>> js_obj.hobbies
['Sing a song', 'Dance to music', 'Eat negi']
Voila!
Development progress
It's still in alpha and unstable. Everything may change in future.
Contributing
TBD
License
This library is released under BSD License.
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
