In [8]:
import axon
from pprint import pprint
Load top-level lis of objects:
In [13]:
text = """
{red:0 green:32 blue:64}
{red:32 green:64 blue:0}
{red:64 green:0 blue:32}
"""
vals = axon.loads(text)
pprint(vals)
print(axon.dumps(vals, pretty=1))
Load top-level ordered map:
In [14]:
text = """
a: [1 2 3]
b: [4 5 6]
c: [7 8 9]
"""
vals = axon.loads(text)
pprint(vals)
print(axon.dumps(vals, pretty=1))
Load JSON
-like objects:
In [16]:
text = """
{
int: [0 1000 123456789123456789123456789]
float: [3.141528 -0 ? ∞ -∞]
decimal: [10000D 3.141528D -0D ?D ∞D -∞D]
bool: (true false)
dict: {red:10 green:32 blue:0}
odict: [red:10 green:32 blue:0]
list: [1 2 3]
node: message {from:"nick" to:"mark" "Hello"}
}
"""
vals = axon.loads(text)
val = vals[0]
pprint(val)
print(axon.dumps(vals, pretty=1))
In [ ]: