This is a Python package that can serialize Python
list & dictionary to Lua
table, or unserialize Lua
table to Python
list & dictionary.
Binary installers for the latest released version are available at the Pypi
.
python -m pip install --upgrade luadata
Serialize
python
variable tolua
data string, and save to specific path.
import luadata
luadata.write(path, data, encoding="utf-8", indent="\t", prefix="return ")
Unserialize
lua
data string topython
variable from file.
import luadata
data = luadata.read(path, encoding="utf-8")
Serialize
python
variable tolua
data string.
import luadata
luadata.serialize(var, encoding="utf-8", indent="\t", indent_level=0)
Unserialize
lua
data string topython
variable.
import luadata
luadata.unserialize(luadata_str, encoding="utf-8", multival=False)