Repository Details
Shared by
HelloGitHub Rating
0 ratings
Free•Apache-2.0
Claim
Discuss
Collect
Share
6.4k
Stars
Yes
Chinese
Python
Language
Yes
Active
24
Contributors
1
Issues
No
Organization
3.10.12
Latest
222
Forks
Apache-2.0
License
More
更快更强的 Python JSON 库。支持比如日期、numpy 数组等丰富的数据类型,而且速度更快
```python
>>> import orjson, datetime, numpy
>>> data = {
"type": "job",
"created_at": datetime.datetime(1970, 1, 1),
"status": "🆗",
"payload": numpy.array([[1, 2], [3, 4]]),
}
>>> orjson.dumps(data, option=orjson.OPT_NAIVE_UTC | orjson.OPT_SERIALIZE_NUMPY)
b'{"type":"job","created_at":"1970-01-01T00:00:00+00:00","status":"\xf0\x9f\x86\x97","payload":[[1,2],[3,4]]}'
>>> orjson.loads(_)
{'type': 'job', 'created_at': '1970-01-01T00:00:00+00:00', 'status': '🆗', 'payload': [[1, 2], [3, 4]]}
```
Comments
Rating:
No comments yet