castletool
Castletool is a terminal tool for injecting files into Castle decks You can inject full color images, GIFs, videos, SVGs, MIDI music, and fonts. (Not affiliated with Monterey's Coast, Inc.)
Installation
pip install castletool
Requires Python 3.10+ and the Castle CLI logged in for deck uploads to work.
Usage
Run castletool from inside (or above) a folder containing your Castle
deck(s), and follow the prompts. cd into where your decks are located (usually ~/decks) if it says it can't find any.
There are two modes:
castletoolopens the default TUI (built with Textual).castletool --cli(orcastletool-cli) opens original terminal interface.
Either way, it works the same way: pick a deck, then a card, then a blueprint (aka. actor) to edit, then an action to perform.
castletool --version (or -v) prints the installed version.
What you can do
- Add image — bitmap images, animated GIF/WEBP/APNG, video (via ffmpeg), and SVG are all supported. Raster images are scaled with nearest-neighbor (no color blending, stays crisp for pixel art). Optional per-frame quantizing and "keep every Nth frame" thinning if you're pushing Castle's size limit.
- Add MIDI — converts a MIDI file into a Castle
Musiccomponent and syncs the card's tempo to match. - Add Font — renders a font's glyphs as vector line art directly into the blueprint. See below for the two ways to pick which characters to render.
- Edit Background Color — sets the card's background color.
- Upload Deck — runs
castle save-deckon the current deck.
Add Font: Basic vs Advanced mode
Basic mode gives you a list of preset unicode ranges select as many as you want:
- Standard (0-255, excluding control characters)
- ASCII
- Alphanumeric
- Numeric
- Currency Symbols
- Greek Characters
- Fraction Symbols
- Arrows
- Mathematical Operators
- Miscellaneous Technical
- Box Drawing
- Block Elements
- Dingbats
- Braille Patterns
- Musical Symbols
Multiple sets are merged together (without duplicates), so picking Mathematical Operators + Miscellaneous Technical + Greek Characters or something else in one pass works fine.
Advanced mode lets you specify exact characters and/or codepoints yourself, either typed directly or loaded from a file:
- Plain characters are typed as-is:
0123456789ABCDEF. - A specific codepoint is written
U+XXXX(hex):U+03A9is Ω. - Separate every
U+XXXXcodepoint with a space something likeU+03A9U+0021is invalid. - Any character or codepoint used twice is is rejected.
Loading from a file uses the same rules, plus:
- Newlines are ignored
--starts a comment that runs to the end of the line.
FAQ
Q: It says I don't have any decks, what do I do?
A: You can initialize a deck by running castle init <name> or get a pre-existing one by running castle get-deck <id> folder
Q: What does quantizing mean?
A: Quantizing automatically makes your image use less data, but it may look worse if the value is too low.
Q: What does it mean by "frame split"?
A: It divides your frames by the value you input. For example, if you enter "2", you will get half the frames.
Q: Why does it say I don't have any decks?
A: You are probably running the command while in a different directory. cd into where your deck folder is located (usually ~/decks)
Q: Add Font says a character set/file has no matches, or skipped some characters — why?
A: Not every font implements every unicode block. Codepoints the font has no glyph for are skipped automatically (you'll get a warning listing how many).
Metadata
Release files for castletool 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| castletool-0.4.6.tar.gz | 31.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| castletool-0.4.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.4 kB
Release files / castletool-0.4.6.tar.gz
| Download URL | castletool-0.4.6.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f906c2eb2eeacdfe0b715f2f89129a3130acc7f87ba32c404a70c950dfface6a
|
|
BLAKE2b-256 checksum How to use checksums |
1da354d6d4a3ca0375e55c65e798e4965a0341a9019fdb5b21d53cc2f4afe555
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / castletool-0.4.6-py3-none-any.whl
| Download URL | castletool-0.4.6-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4173a7d812063ccbf4ba256ab5c4a53be990d8ddc5e7f41ae5152b6a7fb37401
|
|
BLAKE2b-256 checksum How to use checksums |
30afa5ca44b7b1d1cb9d167473d73b88ea4fea88f0f4bb5c3f39096b9185edad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|