Python objects serialization
Project description
Serobj
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
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
serobj-0.0.3.tar.gz
(14.3 kB
view details)
Built Distribution
serobj-0.0.3-py3-none-any.whl
(17.8 kB
view details)
File details
Details for the file serobj-0.0.3.tar.gz
.
File metadata
- Download URL: serobj-0.0.3.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5920dd1fe0f6b5784b3425ba08eeacccaa4d664ab5946803648fefb3c0b36558 |
|
MD5 | 94d154925abaa048fda9572c10cd8932 |
|
BLAKE2b-256 | 6004422ef84f12b1398826c9ea53b0ad89f584448b7d30494c3613305f769675 |
File details
Details for the file serobj-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: serobj-0.0.3-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 510c22f6373fe72465ae1426573572588f9078987270d242cdf869e47c464e68 |
|
MD5 | 3d6a9188016ca7720f60a6a274b41269 |
|
BLAKE2b-256 | 5e281c890c87b490e2abfeabce21df1da920d9ce7e6e9d7c510ee248c94ac841 |