https://github.com/mosquito/fast-json
Fast JSON serialization and deserialization with ujson
https://github.com/mosquito/fast-json
json python3 ujson
Last synced: 3 months ago
JSON representation
Fast JSON serialization and deserialization with ujson
- Host: GitHub
- URL: https://github.com/mosquito/fast-json
- Owner: mosquito
- License: apache-2.0
- Created: 2018-03-01T10:53:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T16:43:45.000Z (over 6 years ago)
- Last Synced: 2025-01-19T06:46:37.989Z (5 months ago)
- Topics: json, python3, ujson
- Language: Python
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
fast-json
=========Combines best parts of json and ujson for fast serialization.
.. code-block:: python
import fast_json
print(
fast_json.dumps({
"foo": "bar",
"now": datetime.datetime.now()
})
)Serializing custom type
~~~~~~~~~~~~~~~~~~~~~~~.. code-block:: python
import fast_json
from collections import namedtupleMyType = 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")
})
)