Skip to main content

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


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 details)

Uploaded Source

File details

Details for the file pyseri-1.1.1.tar.gz.

File metadata

  • Download URL: pyseri-1.1.1.tar.gz
  • Upload date:
  • Size: 1.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for pyseri-1.1.1.tar.gz
Algorithm Hash digest
SHA256 07c7bfdb87394d23d5003d7427959ec9f158ea5cc43bc25a9ad9166d5f75404b
MD5 316e96d499a96a1b474cecc595bfd5ee
BLAKE2b-256 54b00212df577223cad903d809251e93858aaa7968cb50919afa17679f9ee3ae

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page