Skip to content
/ qpack Public
forked from cesbit/qpack

Fast and efficient data serializer (Python)

License

Notifications You must be signed in to change notification settings

Koos85/qpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QPack

QPack is a fast and efficient serialization format like MessagePack. One key difference is flexible map and array support which allows to write directly to a qpack buffer without the need to know the size for the map or array beforehand.

Installation

From PyPI (recommend)

pip install qpack

From source code

python setup.py install

Pack

qpack.packb(object)

Unpack

Unpack serialized data. When decode is left None, each string will be returned as bytes.

qpack.unpackb(qp, decode=None)

Example

import qpack

# define some test data
data = {'name': 'Iris', 'age': 3}

# serialize into qpack format
qp = qpack.packb(data)

# unpack the serialized data
unpacked = qpack.unpackb(qp, decode='utf-8')

# left see what we've got...
print(unpacked)  # {'name': 'Iris', 'age': 3}

About

Fast and efficient data serializer (Python)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 69.6%
  • Python 30.4%