A small library for loading REXPaint .xp files.
Project description
Details
pyrexpaint
is a small API for loading .xp files into python programs. So small, there is a single function provided called load
.
An .xp file is the custom binary format used by the ASCII art editor REXPaint.
Installation
pip install pyrexpaint
or install from source:
git clone https://github.com/mattlink/pyrexpaint
pip install ./pyrexpaint
Usage
Say you have an .xp file hello.xp
in the same directory as your program, it can be loaded using:
import pyrexpaint
image_layers = pyrexpaint.load("hello.xp")
The data structure returned by load
is as follows:
@dataclass
class Tile:
ascii_code: str
fg_r: str
fg_g: str
fg_b: str
bg_r: str
bg_g: str
bg_b: str
@dataclass
class ImageLayer:
width: int
height: int
tiles: List[Tile]
def load(file_name: str) -> List[ImageLayer]:
...
Run the Ncurses Example:
cd ./pyrexpaint/examples
python hello-ncurses.py
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
pyrexpaint-0.0.2.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file pyrexpaint-0.0.2.tar.gz
.
File metadata
- Download URL: pyrexpaint-0.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed1281f2d05c25841fda06b4bddd5e387182ad29a0591554552819fb65d35f2f |
|
MD5 | 1e5f6a44d4561ec354cc18f0d5d31e63 |
|
BLAKE2b-256 | bb5772b2641e7dd99e6dda70cd39ebfaa9bcdc00e0cf59ea1269c4af78d1eea5 |
File details
Details for the file pyrexpaint-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pyrexpaint-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b97ac2bf0ac4dc67621862f465c25d8a7ab1c24fa13517666a64ed56d8885b2 |
|
MD5 | e8ce6cdf6a8867942b387bb60deb25d0 |
|
BLAKE2b-256 | c5e9fd0f2ddf026f9d2ce64e57fadfa02383add9843d0e5cf0124cc44f430cfc |