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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
EndlessParser-0.3.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file EndlessParser-0.3.tar.gz
.
File metadata
- Download URL: EndlessParser-0.3.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 384f30a7f31140d7c4e71d8bdddae830839797000144d347b8683ff98cc7fe8e |
|
MD5 | 842aad6c5c396bdfa4998e980b5f7582 |
|
BLAKE2b-256 | 13c588eb03b9879b6237354ae038c5074a9a410eea41a72c45e524707f8cbbed |
File details
Details for the file EndlessParser-0.3-py3-none-any.whl
.
File metadata
- Download URL: EndlessParser-0.3-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 955c9e05ed3a05e615dd718d07258174ae0241c19b81c86b65b70bf702577b6f |
|
MD5 | 09152e798ecc45ca5f141fdd68f04487 |
|
BLAKE2b-256 | ce47f18f2105e8e198e8d6aa10daf573f22a41ca1803c0d29e07b8add5e928f4 |