Skip to main content

Serializing objects

Project description

serobj is a library for serializing and de-serializing python objects.


import json
import serobj

def print_fn(self, *args):

class A:
    print_fn = print_fn

    def __init__(self):
        self.some_attr = 1, 2, 3

# -------------- dump --------------

obj = A()
data = serobj.dump(obj)
json.dump(data, open("A.json", "w"), indent=4)

# -------------- load --------------

obj = serobj.load(data)
obj.print_fn(*obj.some_attr) # 1 2 3

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for serobj, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size serobj-0.0.0-py2.py3-none-any.whl (17.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size serobj-0.0.0.tar.gz (12.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page