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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file shorser-0.1.1.tar.gz.

File metadata

  • Download URL: shorser-0.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.0 Windows/10

File hashes

Hashes for shorser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 51dfd94376d8b3e27c028cb59763951713671e054aef83d5b9e1b7dace45ac79
MD5 f9f437e5f8a27b859474bc09d4f2b0f2
BLAKE2b-256 73692862200e1c9aae7a24c607a360268cb738c9d273abdbe7e135e390b70102

See more details on using hashes here.

File details

Details for the file shorser-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shorser-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.0 Windows/10

File hashes

Hashes for shorser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66d206fcbb121f02aef1a9294fa1a15514201301e187838308071d0e25923fb4
MD5 32c7d8e34fad70ef60b844d398f6893d
BLAKE2b-256 13cb6a896e9fbe7463a29d5b63b958081e309bd994831fe6b2862b9b3c4c5302

See more details on using hashes here.

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