Python API and CLI tool to read Parkitect's blueprints metadata.
Project description
Parkitect Blueprint Reader
Python API and CLI tool to read Parkitect's blueprints metadata.
PyPI - Documentation - Source code - Issue tracker - Changelog
Prerequisites
- Python >= 3.10
Installation
From PyPi
pip install parkitect-blueprint-reader
Locally
After cloning/downloading the repo:
pip install .
Usage
API
The API consists of one load() method, which reads blueprint metadata from the given binary file-like object and returns
the parsed data as a dictionary.
import parkitect_blueprint_reader
from pprint import pprint
try:
with open('coaster.png', 'rb') as fp: # Note it's opened in binary mode
pprint(
parkitect_blueprint_reader.load(fp)
)
except Exception as e:
print(e)
CLI
The CLI reads metadata from the given blueprint filename, then writes the parsed data as a JSON to stdout.
parkitect-blueprint-reader coaster.png
The --pretty option may be used to pretty-print the outputted JSON.
References
- Parkitect devlog - Update 58
- Reddit - How are blueprints stored?
- GitHub - Parkitect Blueprint Investigation
Development
Getting source code and installing the package with dev dependencies
- Clone the repository
- From the root directory, run:
pip install -e ".[dev]"
Releasing the package
From the root directory, run python setup.py upload. This will build the package, create a git tag and publish on PyPI.
__version__ in parkitect_blueprint_reader/__version__.py must be updated beforehand. It should adhere to Semantic Versioning.
An associated GitHub release must be created following the Keep a Changelog format.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parkitect_blueprint_reader-1.1.0.tar.gz.
File metadata
- Download URL: parkitect_blueprint_reader-1.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f41c54eeacefee29ad24df72d76393704dbd6eae5a906821f2708a7d1be304f
|
|
| MD5 |
5c10858bd1a2197b81806486221a3d4f
|
|
| BLAKE2b-256 |
b5ef59288ccc98b76e83eb8d9addf42262a31b7f8e2ef485fad81b8a383a9dfb
|
File details
Details for the file parkitect_blueprint_reader-1.1.0-py3-none-any.whl.
File metadata
- Download URL: parkitect_blueprint_reader-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cb7bd1839edcdacc20e2eecb4159ce3056760d27069df258cf1fa98fd727798
|
|
| MD5 |
81abd26b5d799b7da89bee51b2412445
|
|
| BLAKE2b-256 |
869b4b539b0684ecc2313ddf85412fd184c2e9e0bbe3bdd26458c5c9f6e804de
|