No project description provided
Project description
generic-json-encoders
A speedier version of the lilya encoders with more correct results and support for pydantic and msgspec. It uses under the hood orjson.
Table of Contents
Installation
pip install generic-json-encoders
Usage
import datetime
from decimal import Decimal
from generic_json_encoders import json_encode, simplify
test_obj = {
"datetime": datetime.datetime.now(),
"date": datetime.date.today(),
"decimal": Decimal("0.3").
}
# get json byte string
print(json_encode(test_obj))
# get simplified json serializable object
print(json_encode(test_obj))
Integrating in lilya
Put somewhere in the init code of your application
from importlib import import_module
from contextlib import suppress
...
with suppress(ImportError):
import_module("generic_json_encoders.lilya_monkey_patcher")
...
License
generic-json-encoders
is distributed under the terms of the BSD license.
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
Built Distribution
File details
Details for the file generic_json_encoders-0.0.1.tar.gz
.
File metadata
- Download URL: generic_json_encoders-0.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffee2865eb085cc89aa018352c795333e22fd059107129503ede5afa417f1363 |
|
MD5 | 6e5ac61ebbc1302df9995f9f1517898f |
|
BLAKE2b-256 | a3eb63825a8a8213f36cda758f7f6c43ddc763fae465df75ccd41969c26ef637 |
File details
Details for the file generic_json_encoders-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: generic_json_encoders-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de51714b2676f2828aea7885a34a8eba40253219cb6a4a1808eba574c16c145d |
|
MD5 | 2bacf945a4d89ff13f8bcbf43334d746 |
|
BLAKE2b-256 | bf0750e798bc215522f5caec1b6134157fd94ec3dff5f2cf744cd1d29f7fccde |