Skip to main content

A library to encode/decode luabins serialized data in python

Project description


A simple python library for encoding and decoding luabins formatted serialized data.


def decode_luabins(stream: BytesIO) -> List[Any]

Given a file-like object (here BytesIO, but a raw file pointer should work as well), this will return the list of values decoded from the file.

def encode_luabins(values: List[Any]) -> bytes

Given a set of values, it will serialize them to bytes in the luabins format.

Supported types are:

  • String
  • Int
  • Float
  • Dict
  • List
  • None
  • Bool


In lua, arrays and maps have the same underlying representation, whereas in python, they're differentiated more. This means that you can serialize a list, but it will deserialize to a dict, where the keys are the original indexes, and there is some potential for weirdness there.

I believe this library supports the full scope of the lua data model, so this mostly crops up if you try to do some weird python stuff.

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for luabins-py, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size luabins_py-1.0.0-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size luabins_py-1.0.0.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page