In development
Easy-ish translation between data objects and the DOM we know as LaTeX.
from pprint import pprint
from PyTeX import latex
with open('data/simple.tex', 'r') as f:
data = latex.load(f)
pprint(data)
[{'documentclass': {'arguments': ['article']}},
{'document': {'data': ['This is a LaTeX document.']}}]
from pprint import pprint
from PyTeX import latex
with open('data/simple.bib', 'r') as f:
data = latex.load(f)
pprint(data)
{'test': {'author': 'Dillon Niederhut',
'title': 'Structured data with PyTeX',
'type': 'article',
'year': '2016'}}
for result in latex.find('data', data):
pprint(result)
{'data': ['This is a LaTeX document.']}