Skip to main content

a shorter serializer

Project description

shorser

Shorter serializer. Helpful if you are using sqlitedict / filecache to store key value pairs.

Usage

To use shorser with std json backend:

from shorser import jdump, jload

bytes_buf = jdump(obj)
obj = jload(bytes_buf)

Compare with JSON

Value JSON (utf-8 encoded) shorser (with JSON backend) Saved bytes
None b'null' None 4
True b'true' b'y' 3
False b'false' b'n' 3
100 b'100' b'id' (store integer in little order bytes, with prefix i) a lot
'vnais' b'"vnais"' b'svnais' 1
b'dsads15' Not Support b'bdsads15'
{'a': 10} b'{"a": 10}' b'u{"a": 10}' -1
  • shorser is support bytes type;
  • integer type is unreadable;
  • in most cases, shorser is smaller than backend (like JSON);
  • in most cases, shorser is faster than backend (like JSON);

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

shorser-0.1.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

shorser-0.1.1-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page