Skip to main content

shibazuzke — Fast object serializer for Python

shibazuzke provides simple and fast object serialization. Usually shibazuzke generates smaller data than picke or JSON, and faster on both serialization and de-serialization. shibazuke is intended to be safely used for interprocess-communications, so hopefully de-serializing maliciously crafted data doesn’t harm.

Usage

dumps(obj)

Return the shibazuke representation of the object as a string.

loads(string)

Read a shibazuke object hierarchy from a string.

Exapmle

Here’s simple example of shibazuzke:

>>> import shibazuke
>>> data = ['abc', {1:(2,3,4)}]
>>> result = shibazuke.dumps(data)
>>> data == shibazuke.loads(result)
True

Limitations

  • Following type of Python objects could be serialized.

    int, long, str, unicode, tuple, list, dict

  • Number of objects to be serialized is limited to 2147483647.

  • Length of serialized string is limited to 2147483647.

  • Max depth of object graphs is limited to 100, and circular reference is not supported.

    >>> import shibazuke
    >>> list1 = []
    >>> list2 = [list1]
    >>> list1.append(list2)
    >>> shibazuke.dumps(list1)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "shibazuke.pyx", line 524, in shibazuke.dumps
      File "shibazuke.pyx", line 309, in shibazuke.Serializer.dumps
      File "shibazuke.pyx", line 300, in shibazuke.Serializer._build
      File "shibazuke.pyx", line 246, in shibazuke.Serializer._handle_list
      File "shibazuke.pyx", line 300, in shibazuke.Serializer._build
      File "shibazuke.pyx", line 246, in shibazuke.Serializer._handle_list
      File "shibazuke.pyx", line 300, in shibazuke.Serializer._build
      File "shibazuke.pyx", line 238, in shibazuke.Serializer._handle_list
    ValueError: Circular refecence([[[...]]])
    
  • Objectes can occur multiple times in the object tree to be serialized, but they are de-serialized as differect objects.

    >>> import shibazuke
    >>> list1 = []
    >>> list2 = [list1, list1]
    >>> result = shibazuke.dumps(list2)
    >>> serialized = shibazuke.loads(result)
    >>> serialized[0] is serialized[1]
    False
    

Metadata

Release files for Shibazuke 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Shibazuke 0.1.1
File Size Uploaded
Shibazuke-0.1.1.zip 35.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Shibazuke 0.1.1
File Interpreter ABI Platform
Shibazuke-0.1.1-py2.6-win32.egg Legacy Egg format - - Details

Total release size: 54.9 kB

Release files / Shibazuke-0.1.1.zip

Download URL Shibazuke-0.1.1.zip
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
71a2c0e666d6f8b2acc3b63dcb8cff24a401c7754a92510e86005e8f74357694
BLAKE2b-256 checksum
How to use checksums
05cc9278bd56b88d4c2d2ba24f0d892bc3ae07cae7531c4ad83bb158dbb41e22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Shibazuke-0.1.1-py2.6-win32.egg

Download URL Shibazuke-0.1.1-py2.6-win32.egg
Size 19.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
3a6d98eb8ba8a2bc989c6d0ec30cb8641182c13853bb472dfd74d7d773a5b29e
BLAKE2b-256 checksum
How to use checksums
02f20b143a5ab183caf9147a0b78ad85dc64b3e16ef256e6705c6d9f9b02ee60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page