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
Built Distribution
File details
Details for the file yajbe-0.0.7.tar.gz
.
File metadata
- Download URL: yajbe-0.0.7.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fded04fbcaef413a8096fc6aba49a06bbbe58b3ea6afb183748affa5ce4ea35 |
|
MD5 | c252c723b3c017cd4bafec65f82c739d |
|
BLAKE2b-256 | ad1b2f21b1e970eb939b19e29960ef0f9599f601b167181d6ac21c63c4c999a8 |
File details
Details for the file yajbe-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: yajbe-0.0.7-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e519b77c6dae44e4f6e0a90b894a104571d592003f0c621ac98b4a7d1e4ad937 |
|
MD5 | 6c122d5d171044869b47232199759df9 |
|
BLAKE2b-256 | 4b4be251308fe38a6d9c9e9a9332f17ac6b9cb5d4b8ac25a988a98f1d9214414 |