Python Serializer tool
Project description
from pyseri import serializer
class A():
name = 'class a'
class B():
name = 'class b'
a = [A(), A(), A()]
serializer.dump(B(), mapper={'A': {'name'}, 'B':{'name', 'a'}})
#output
"""
{
'name': 'class b',
'a': [
{'name': 'class a'},
{'name': 'class a'},
{'name': 'class a'}
]
}
"""
from pyseri import serializer
class A():
getters = ['name']
#this key is important
name = 'class a'
class B():
getters = ['name', 'a']
#this key is important
name = 'class b'
a = [A(), A(), A()]
serializer.dump(B())
#output
"""
{
'a': [
{'name': 'class a'},
{'name': 'class a'},
{'name': 'class a'}
],
'name': 'class b'}
"""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyseri-1.1.1.tar.gz
(1.2 kB
view hashes)