Skip to main content

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.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

SLPP-1.2.1-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file SLPP-1.2.1.tar.gz.

File metadata

  • Download URL: SLPP-1.2.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for SLPP-1.2.1.tar.gz
Algorithm Hash digest
SHA256 81cdc8a409b0cd727ab1485b7727c0623a372f6cfe1dcdc0e82296376acb4d0c
MD5 f30a80ab98dc51f2d34e22754308ddb0
BLAKE2b-256 02382d004dcfb4fb9e3b0e677808d1ca9b7c3835ef0ba4d08df357cd00d79807

See more details on using hashes here.

Provenance

File details

Details for the file SLPP-1.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: SLPP-1.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for SLPP-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d7f0b159e4bfeac79fd6c7bbff00aa16dfb8fd9aa25321f26329770ce9e0db0c
MD5 60df960e42ba85138f3e179260bafad1
BLAKE2b-256 33dc34b3b198cf27b9b00c25c457a1793dec7f7a4bcd8f7becc65cb3fe5da857

See more details on using hashes here.

Provenance

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