Skip to main content

Python objects serialization

Project description

Serobj

License

Serobj is a library for serializing and de-serializing program objects.

Getting started

Run pip install serobj to install the latest stable version from PyPI.

Example:

import json
import serobj

def print_fn(self, *args):
    print(*args)

class A:
    print_fn = print_fn

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


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

obj = A()
data = serobj.dumps(obj)

with open("A.json", "w") as f:
    json.dump(data, f, indent=4)


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

with open("A.json", "r") as f:
    data = json.load(f)

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

Project details


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.3
Filename, size File type Python version Upload date Hashes
Filename, size serobj-0.0.3-py3-none-any.whl (17.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size serobj-0.0.3.tar.gz (14.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page