Skip to main content

YAJBE is a compact binary data format built to be a drop-in replacement for JSON (JavaScript Object Notation).

Project description

YAJBE for Python

YAJBE is a compact binary data format built to be a drop-in replacement for JSON (JavaScript Object Notation).

Motivation for a new format

We have a lot of services exchanging or storing data using JSON, and most of them don't want to switch to a data format that requires a schema.

We wanted to remove the overhead of the JSON format (especially field names), but keeping the same data model flexibility (numbers, strings, arrays, maps/objects, and a few values such as false, true, and null).

See more at https://github.com/matteobertozzi/yajbe-data-format

Install the package

You can find the package at https://pypi.org/project/yajbe.
Python >=3.10 is required. To install or upgrade you can use:

$ pip install --upgrade yajbe

Usage

import yajbe

# encode and decode from bytes
enc = yajbe.encode_as_bytes({'a': 10, 'b': ['hello', 10]})
dec = yajbe.decode_bytes(enc)
print(dec)

# encode directly to a stream
with open('test.yajbe', 'wb') as fd:
  yajbe.encode_to_stream(fd, {'a': 10, 'b': ['hello', 10]})

# decode directly from a stream
with open('test.yajbe', 'rb') as fd:
  print(yajbe.decode_stream(fd)) # {'a': 10, 'b': ['hello', 10]}

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

yajbe-0.0.6.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

yajbe-0.0.6-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file yajbe-0.0.6.tar.gz.

File metadata

  • Download URL: yajbe-0.0.6.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for yajbe-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1a97ed3fb7abe34a722368fb66e25633bea4c4d8a56941dccea9499512f8e10a
MD5 c0a94a45292a30bbcaebb1d5f4997d74
BLAKE2b-256 a0f03d70b9aeeb075f9fce2092c45d145b2fd65baf714407c4f4c59b25916a4a

See more details on using hashes here.

File details

Details for the file yajbe-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: yajbe-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for yajbe-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b2886beaf23397d58f087d2d74ecc6f2055e33c005c9525edd3e0d4537e24e5d
MD5 dc31e76b3b500f44594044a57a736504
BLAKE2b-256 baa263dfd6588e7cf31e768fc392e7e88b12ac22e484650a2ec335a9962b91f1

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