Skip to main content

Serialize and unserialize Python list & dictionary between Lua table.

Project description

luadata

Build Status PyPI

This is a Python package that can serialize Python list & dictionary to Lua table, or unserialize Lua table to Python list & dictionary.

Install

Binary installers for the latest released version are available at the Pypi.

python -m pip install --upgrade luadata

Usage

write

Serialize python variable to lua data string, and save to specific path.

import luadata

luadata.write(path, data, encoding="utf-8", indent="\t", prefix="return ")

read

Unserialize lua data string to python variable from file.

import luadata

data = luadata.read(path, encoding="utf-8")

serialize

Serialize python variable to lua data string.

import luadata

luadata.serialize(var, encoding="utf-8", indent="\t", indent_level=0)

unserialize

Unserialize lua data string to python variable.

import luadata

luadata.unserialize(luadata_str, encoding="utf-8", multival=False)

License

BSD

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

luadata-1.0.5.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

luadata-1.0.5-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

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