Json library which enable user to parse and dump data with hex escape
Project description
Hexson
Json library designed for binary data processing.
Different from built-in json library, Hexson can encode invisible characters with hex escape instead of unicode escape.
Install
pip3 install hexson
Usage
loader & dumpper
Serialize from / Deserialize to file:
json_dict = hexson.load(fd)
hexson.dump(json_dict, fd)
Serialize from / Deserialize to string:
json_dict = hexson.loads(json_string)
json_string = hexson.dumps(json_dict)
Function load and loads will parse string in Json to bytes in Python by default.
And you can convert it into string in Python by set parameter utf_8_string to True, just like:
json_dict = hexson.load(fd, utf_8_string=True)
json_dict = hexson.loads(json_string, utf_8_string=True)
Elasticsearch serializer
Hexson can work along with official elasticsearch Python client library.
import elasticsearch
hexson_serializer = hexson.JSONSerializer()
es_conn = elasticsearch.Elasticsearch(serializer=hexson_serializer)
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
hexson-0.0.5.tar.gz
(5.1 kB
view details)
File details
Details for the file hexson-0.0.5.tar.gz.
File metadata
- Download URL: hexson-0.0.5.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96e95de72aecd9ae545376bc87653291bcb879d810e3569dcd30a08683764686
|
|
| MD5 |
277be6142187917309053507dfc10f32
|
|
| BLAKE2b-256 |
845d449daa629d47b259f342e1a6add57ab6302876e0dde5e6d16401d27fd062
|