AXON 0.5β documentation

What is AXON

Contents   ::   API  »

What is AXON

AXON is eXtended Object Notation (AXON). It’s a simple text based format for interchanging of objects, documents and data.

It tries to combine the best of JSON, XML and YAML.

AXON is designed as text based language for data exchange in first place.

Creation of AXON had following objectives:

AXON is designed as text based format that has compact form and formatted form in both C and Python style for ease of developers.

AXON is an object notation for data, which are composed from atomic values by several rules of composition:

NameRuleExample
list[ VV ]
[1 3.14 3.25$ -∞ ?]
tuple( VV )
(true 12:00 2001-12-31 2001-12-31T12:00)
dictionary{ K:VK:V }
{alpha:1 beta:2 gamma:3 "other chars":4}
mappingN { N:VN:V }
greek {alpha:123 beta:212 gamma:322}
sequenceN { VV }
primes {2 3 5 7 11 13 17 19 23}
elementN { N:VN:V VV }
node {id:1 node{id:2 "AAA"} node{id:3 "BBB"}}
instanceN { VV N:VN:V }
datarow { 1 2003-12-01T12:30 T:12.5 R:0.95 W:11 D:"NW"}
emptyN { }
empty { }

where N denotes a name, K denotes a key, V denotes a value.

Here is an example of AXON message:

statement formformatted expression form
axon:
    name: "An eXtended Object Notation"
    short_name: "AXON"
    python_library: "pyaxon"
    atomic_values:
        int: [0 -1 17]
        float: [3.1428 1.5e-17]
        decimal: [10$ 1000.35$ -1.25e6$]
        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: |UTcJFhV3cl97ZEk+BA0hWggDUj8lbE0bQH5r
Uy0nNjwmZDpANClsAj4WeDsfCWkcW2Bdc0VNQ
CQVZCBhXxFGJBpSLGs3HGlcbSdgdH4ab34UBT
wndTs2MXdSOxIGBgdYclFQYnlDH3NfUSI1LEc
HDARDeFcDCBwiPTAZODU=
    complex_values:
        anonymous:
            list: ["one" "two" "three"]
            dict: {"one":1 "two":2 "three":3}
            tuple: ("nodes" "edges")
        named:
            mapping: rgb:
                red:16 green:32 blue:64
            element: node:
                id: 1
                node:
                    id: 2
                    class: "A"
                node:
                    id: 3
                    class: "B"
            sequence: primes:
                2 3 5 7 11 13 17 19 23 29 31
            instance: row:
                12 2003-12-01 12:00
                T: 12.1 R:0.5 W:5 D:"W"
axon {
    name: "An eXtended Object Notation"
    short_name: "AXON"
    python_library: "pyaxon"
    atomic_values {
        int: [0 -1 17]
        float: [3.1428 1.5e-17]
        decimal: [10$ 1000.35$ -1.25e6$]
        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: |UTcJFhV3cl97ZEk+BA0hWggDUj8lbE0bQH5r
Uy0nNjwmZDpANClsAj4WeDsfCWkcW2Bdc0VNQ
CQVZCBhXxFGJBpSLGs3HGlcbSdgdH4ab34UBT
wndTs2MXdSOxIGBgdYclFQYnlDH3NfUSI1LEc
HDARDeFcDCBwiPTAZODU=
    }
    complex_values {
        anonymous {
            list: ["one" "two" "three"]
            dict: {"one":1 "two":2 "three":3}
            tuple: ("nodes" "edges")
        }
        named {
            mapping: rgb {
                red:16 green:32 blue:64}
            element: node {
                id: 1
                node {
                    id: 2
                    class: "A"}
                node {
                    id: 3
                    class: "B"}
                }
            sequence: primes {
                2 3 5 7 11 13 17 19 23 29 31}
            instance: row {
                12 2003-12-01 12:00
                T: 12.1 R:0.5 W:5 D:"W"}
        }
    }
}
compact expression form
axon{name:"An eXtended Object Notation" python_library:"pyaxon" short_name:"AXON"
atomic_values{binary:|UTcJFhV3cl97ZEk+BA0hWggDUj8lbE0bQH5rUy0nNjwmZDpANClsAj4We
DsfCWkcW2Bdc0VNQCQVZCBhXxFGJBpSLGs3HGlcbSdgdH4ab34UBTwndTs2MXdSOxIGBgdYclFQYnlDH
3NfUSI1LEcHDARDeFcDCBwiPTAZODU=
bool:[true false] date:2012-12-31 datetime:[2012-12-31T12:30 2012-12-31T12:35+03]
decimal:[10$ 1000.35$ -1.25E+6$] float:[3.1428 1.5e-17] int:[0 -1 17] multiline_string:"one
two
three" string:"abc абв 中文本" time:[12:30:34 12:35:12.000120 12:35+03]}
complex_values{anonymous{dict:{one:1 three:3 two:2} list:["one" "two" "three"]
tuple:("nodes" "edges")} named{element:node{id:1 node{class:"A" id:2} node{class:"B" id:3}}
instance:row{12 2003-12-01 12:00 D:"W" R:0.5 T:12.1 W:5} mapping:rgb{blue:64 green:32 red:16}
sequence:primes{2 3 5 7 11 13 17 19 23 29 31}}}}

Python pyaxon library

pyaxon is an MIT Licensed python library for AXON.

There are introductory IPython notebooks:

Repository for AXON and pyaxon is here. Here is also mirror.

API Reference

Contents   ::   API  »