Simple json serializable object
Project description
simpleobject
Simple json serializable object
Can be used as a types.SimpleNamespace
, but it is json serializable like a python dictionary.
Install
python -m pip install simpleobject
Usage
from simpleobject import simpleobject
from json import dumps
o = simpleobject()
o.foo = 1
o.bar = 2
print(o) #simpleobject(foo=1, bar=2)
print(dumps(o)) #{"foo": 1, "bar": 2}
You can also set the name
o.name = 'FooBarObject'
print(o) #FooBarObject(foo=1, bar=2)
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
simpleobject-1.0.4.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for simpleobject-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 808323911db9fd4687b95d9ace21690f25d831255341e1aa4c319e16bda2c619 |
|
MD5 | 15b5c3c16710e25fe5b6ec050cf63256 |
|
BLAKE2b-256 | 0334e126b278f0507852a54133182eb97a55805d4288b6aafa98202e3cb20123 |