AST inspection

You can call raw() on a document or any element in it to get a native python object serialization of the abstract syntax tree constructed by enolib.

>>> enolib.parse('> note\ngreeting: hello').raw()
{
  'type': 'document',
  'elements': [{
    'comment': 'note',
    'key': 'greeting',
    'type': 'field',
    'value': 'hello'
  }]
}

Although this can theoretically be used to get a plain object dump of an eno document, it is solely intended for debugging purposes, as there is no validation and no types and the serialization structure is rather verbose to work with as well.


Next page: FAQ