Skip to main content

A robust Parser for Endless Sky's data files.

Project description

EndlessParser

A robust Parser for Endless Sky's data files

Usage

$ pip install endlessparser
>>> from endlessparser import parse
>>> with open("map.txt", "r") as f:
...     nodes = parse(f.read())
...
>>> nodes[0]
GalaxyNode(node_type='galaxy', tokens=['"Milky Way"'], children=[Node(node_type='pos', tokens=['0', '0'], children=[]), Node(node_type='sprite', tokens=['ui/galaxy'], children=[])])
>>> nodes[0].name()
'"Milky Way"'
>>> nodes[0].sprite()
'ui/galaxy'
>>> nodes[0].position()
(0.0, 0.0)

Contributing

Requirements:

  • Python >= 3.7 for syntactic sugar
  • black for formatting (please use it before commiting - it also integrates into most editors)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for EndlessParser, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size EndlessParser-0.3-py3-none-any.whl (18.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size EndlessParser-0.3.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page