SLPP is a simple lua-python data structures parser
Project description
SLPP
SLPP is a simple lua-python data structures parser.
Lua data check:
data = '{ array = { 65, 23, 5 }, dict = { string = "value", array = { 3, 6, 4}, mixed = { 43, 54.3, false, string = "value", 9 } } }'
> data = assert(loadstring('return ' .. data))()
> for i,j in pairs(data['dict']) do print(i,j) end
mixed table: 0x2014290
string value
array table: 0x2014200
Parse lua data:
>>> from slpp import slpp as lua
>>> data = lua.decode('{ array = { 65, 23, 5 }, dict = { string = "value", array = { 3, 6, 4}, mixed = { 43, 54.3, false, string = "value", 9 } } }')
>>> print data
{'array': [65, 23, 5], 'dict': {'mixed': {0: 43, 1: 54.33, 2: False, 4: 9, 'string': 'value'}, 'array': [3, 6, 4], 'string': 'value'}}
Dump python object:
>>> lua.encode(data)
'{array = {65,23,5},dict = {mixed = {43,54.33,false,9,string = "value"},array = {3,6,4},string = "value"}}'
Dump test:
> data = assert(loadstring('return ' .. '{array = {65,23,5,},dict = {mixed = {43,54.33,false,9,string = "value",},array = {3,6,4,},string = "value",},}'))()
> print(data['dict'])
table: 0x1b64ea0
> for i,j in pairs(data['dict']) do print(i,j) end
mixed table: 0x880afe0
array table: 0x880af60
string value
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
SLPP-1.2.3.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file SLPP-1.2.3.tar.gz
.
File metadata
- Download URL: SLPP-1.2.3.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21fdd9328348090c71a5d32773e8ee68aab8ad7ecc322f5e0cc010114cb549c8 |
|
MD5 | 71d011632ec487ad761fb807413c6deb |
|
BLAKE2b-256 | 7c74634e94098bec76b79902d7ff5cb82a2c5a50bb20167bf30eaba0298548e0 |
File details
Details for the file SLPP-1.2.3-py2.py3-none-any.whl
.
File metadata
- Download URL: SLPP-1.2.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2ff423e6afe8f49c56ed60209790a7e15a239c6d4a0a034337ab9d175389227 |
|
MD5 | 127fa8d1075dae1a194af95401152c4f |
|
BLAKE2b-256 | 2d5b906a2f65d87a80041af995586d0b6d5e885f32943906298f0268639257d4 |