Skip to main content

A library to encode/decode luabins serialized data in python

Project description

luabins_py

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

API

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

Limitations

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


Download files

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

Source Distribution

luabins_py-1.4.0.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file luabins_py-1.4.0.tar.gz.

File metadata

  • Download URL: luabins_py-1.4.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for luabins_py-1.4.0.tar.gz
Algorithm Hash digest
SHA256 4d7115b6756aca710cd24ed81fa8709b0890e5ad4662f23e874650aad5981770
MD5 386b708577d83a347f65bbdf062005c1
BLAKE2b-256 b61490263f9c36b11f9c68b06ff47cf1396e22119acce11ed5d9000e4dff8801

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