Skip to content

Fast JSON serialization and deserialization with ujson

License

Notifications You must be signed in to change notification settings

mosquito/fast-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fast-json

Combines best parts of json and ujson for fast serialization.

import fast_json

print(
    fast_json.dumps({
        "foo": "bar",
         "now": datetime.datetime.now()
    })
)

Serializing custom type

import fast_json
from collections import namedtuple


MyType = namedtuple("MyType", ["name", "value"])


@fast_json.convert.register(MyType)
def _(value):
    return "name={0.name} value={0.value}".format(value)


print(
    fast_json.dumps({
        "one": MyType(name="foo", value="bar")
    })
)

About

Fast JSON serialization and deserialization with ujson

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages