Skip to main content

Convert Python objects to Emap which is friendly data exchange format for Neos VR

Project description

py2emap

py2emap is a module that converts Python objects to Emap.

Emap is designed to be useful for exchange data between Neos VR and external applications.

Installation

$ pip install py2emap

How to use?

import py2emap

pydata = {
    "name": "John",
    "age": 30,
    "address": {
        "street": "Main Street",
        "city": "New York",
        "state": "NY"
    }
}

string = py2emap.dumps(pydata)
print(string)
# =>
# l$#5$#v$#k0$#name$#v0$#John$#t0$#string$#k1$#age$#v1$#30$#t1$#number$#k2$#address.street$#v2$#Main Street$#
# t2$#string$#k3$#address.city$#v3$#New York$#t3$#string$#k4$#address.state$#v4$#NY$#t4$#string$#

Also, you can convert json to emap in command line.

$ python -m py2emap '{"key1": "value1", "key2":"value2"}'
l$#2$#v$#k0$#key1$#v0$#value1$#t0$#string$#k1$#key2$#v1$#value2$#t1$#string$#

It can take stdin.

$ echo '{"key1": "value1", "key2":"value2"}' | python -m py2emap -
l$#2$#v$#k0$#key1$#v0$#value1$#t0$#string$#k1$#key2$#v1$#value2$#t1$#string$#

By bringing these converted strings into Neos, objects can be easily restored and handled through LogiX. Please see the proposer's repository for more details on how to handle this in Neos.

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

py2emap-0.1.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

py2emap-0.1.0-py3-none-any.whl (3.5 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