A working, tested Python conversion of the C++ parser for Endless Sky DataFiles
pip install endless-sky-parse==0.1.2
A working, tested Python conversion of the C++ parser for Endless Sky DataFiles
$ pip install endless-sky-parse
from endless_sky.datafile import DataFile
f = DataFile("/usr/share/games/endless-sky/data/human/ships.txt")
it = f.root.filter(["ship", "Blackbird"])
ship = next(it)
ship.children[0]
# DataNode(tokens=['sprite', 'ship/blackbird'], children=[])
next(ship.filter_first("description")).tokens[1][:80]
# 'The Tarazed Blackbird is a high-class passenger transport, designed to move larg'
$ python -m venv venv && . venv/bin/activate
$ pip install -r dev_requirements.txt
Run tests with
$ python setup.py test