What is AXON¶
AXON is eXtended Object Notation (AXON). It’s a simple text based format
for interchanging of objects, documents and data.
There is railroad diagram
in order to describe AXON.
It tries to combine the best of JSON, XML and YAML.
Creation of AXON had following objectives:
- Overcoming lack of support of date/time, decimal and binary data in
JSON. - Overcoming inability to represent in
JSONcomplex data with cross-references natively. - Extension of
JSONfor native support of named/taged data structures (typed complex data, elements of documents etc.) in order to act in cases whereXMLis more suitable thanJSON. - Support both
JSON-style andYAML-style of formattingAXONmessages. - Removing
','as mandatory character-separator for items in containers. - Saving relative simplicity of the language compared to
JSON.
AXON is designed as text based format that has compact form and
formatted form in both JSON/C and YAML/Python style for ease of developers.
AXON is an object notation for data, which are composed from atomic values
by several rules of composition:
| Name | Rule | Example |
|---|---|---|
| list | [ V … V ] | [1 3.14 3.25D ∞ -∞ ?] |
| tuple | ( V … V ) | (true 12:00 2001-12-31 2001-12-31T12:00) |
| dict | { K:V … K:V } |
{alpha:1 beta:2 gamma:3 "other chars":4}
|
| ordered dict | [ K:V … K:V ] | [alpha:1 beta:2 gamma:3 "other chars":4] |
| node | N { N:V … N:V V … V } |
greek {alpha:123 beta:212 gamma:322}
primes {2 3 5 7 11 13 17 19 23}
tree {id:1 leaf{id:2 "AAA"} leaf{id:3 "BBB"}}
|
where N denotes a name, K denotes a key, V denotes a value.
Here is an example of AXON message:
| statement form | formatted expression form |
|---|---|
axon
name: "AXON is eXtended Object Notation"
short_name: "AXON"
python_library: "pyaxon"
atomic_values
int: [0 -1 17]
float: [3.1428 1.5e-17]
decimal: [10D 1000.35D -1.25E+6D]
bool: [true false]
string: "abc абв 中文本"
multiline_string: "one
two
three"
date: 2012-12-31
time: [12:30:34 12:35:12.000120 12:35+03]
datetime: [2012-12-31T12:30 2012-12-31T12:35+03]
binary: |QVhPTiBpcyBlWHRlbmRlZCBPYmplY3QgTm90YXRpb24=
complex_values
list: ["one" "two" "three"]
dict: {
one: 1
three: 3
two: 2}
odered_dict: [
one: 1
three: 3
two: 2]
tuple: ("nodes" "edges")
node: person
name: "Alex"
age: 32
|
axon {
name: "AXON is eXtended Object Notation"
short_name: "AXON"
python_library: "pyaxon"
atomic_values {
int: [0 -1 17]
float: [3.1428 1.5e-17]
decimal: [10D 1000.35D -1.25E+6D]
bool: [true false]
string: "abc абв 中文本"
multiline_string: "one
two
three"
date: 2012-12-31
time: [12:30:34 12:35:12.000120 12:35+03]
datetime: [2012-12-31T12:30 2012-12-31T12:35+03]
binary: |QVhPTiBpcyBlWHRlbmRlZCBPYmplY3QgTm90YXRpb24=
}
complex_values {
list: ["one" "two" "three"]
dict: {
one: 1
three: 3
two: 2}
odered_dict: [
one: 1
three: 3
two: 2]
tuple: ("nodes" "edges")
node: person {
name: "Alex"
age: 32}}}
|
| compact expression form | |
axon{name:"AXON is eXtended Object Notation" short_name:"AXON" python_library:"pyaxon"
atomic_values{int:[0 -1 17] float:[3.1428 1.5e-17] decimal:[10D 1000.35D -1.25E+6D]
bool:[true false] string:"abc абв 中文本" multiline_string:"one
two
three" date:2012-12-31 time:[12:30:34 12:35:12.000120 12:35+03]
datetime:[2012-12-31T12:30 2012-12-31T12:35+03]
binary:|QVhPTiBpcyBlWHRlbmRlZCBPYmplY3QgTm90YXRpb24=
} complex_values{list:["one" "two" "three"] dict:{one:1 three:3 two:2}
odered_dict:[one:1 two:2 three:3] tuple:("nodes" "edges") node:person{name:"Alex" age:32}}}
| |
Python pyaxon library¶
pyaxon is an MIT Licensed
python library for AXON.
There are some IPython notebooks.
Repository for AXON and pyaxon.
Mirror on github.
Blog about AXON.
History of changes.