Skip to main content

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.

Python versions Version License

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

Development

Getting source code and installing the package with dev dependencies

  1. Clone the repository
  2. 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

parkitect_blueprint_reader-1.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parkitect_blueprint_reader-1.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file parkitect_blueprint_reader-1.1.0.tar.gz.

File metadata

File hashes

Hashes for parkitect_blueprint_reader-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5f41c54eeacefee29ad24df72d76393704dbd6eae5a906821f2708a7d1be304f
MD5 5c10858bd1a2197b81806486221a3d4f
BLAKE2b-256 b5ef59288ccc98b76e83eb8d9addf42262a31b7f8e2ef485fad81b8a383a9dfb

See more details on using hashes here.

File details

Details for the file parkitect_blueprint_reader-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for parkitect_blueprint_reader-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cb7bd1839edcdacc20e2eecb4159ce3056760d27069df258cf1fa98fd727798
MD5 81abd26b5d799b7da89bee51b2412445
BLAKE2b-256 869b4b539b0684ecc2313ddf85412fd184c2e9e0bbe3bdd26458c5c9f6e804de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page