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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py2emap-0.1.0.tar.gz.
File metadata
- Download URL: py2emap-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.15.37-gentoo-x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d965f051675e0f338d7bd11e263fff8242dafa8e4bb82d3158afd54374b42506
|
|
| MD5 |
7dfd33ba694c2ffdfc846cfd4c66f7c4
|
|
| BLAKE2b-256 |
ed46ec31eafcfbd484582e9d59b5f067afde0e5dd9c38846b94d8d71a6f84b78
|
File details
Details for the file py2emap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: py2emap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.15.37-gentoo-x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11848f097bbf74ca1d21d41480a52521e001cdd5a9530ee77f0cd8151780764b
|
|
| MD5 |
698d0cdff29774106023445fd2fe2d9b
|
|
| BLAKE2b-256 |
3f6a5f215e4d7c477dc64227ee9cc0eda4a328450847f5e76589dd6d92d639fd
|