Python TUI for browsing LDraw library.
Project description
pyldraw3-tui
A terminal user interface for browsing the LDraw parts catalog and inspecting LDraw model files — built on Textual and pyldraw3.
LDraw is the open standard for describing LEGO® models as plain-text
.ldr/.mpd files. pyldraw3-tui is the read-only companion to the pyldraw3 library: it never
creates, edits, or exports model or geometry files — it just lets you explore parts and models
fast, without leaving your terminal.
Contents
Installation
Requires Python 3.12+ and a terminal.
Run it without installing anything (recommended):
uvx pyldraw3-tui
Or install it as a persistent command-line tool:
uv tool install pyldraw3-tui # via uv
pipx install pyldraw3-tui # or via pipx
Want the latest unreleased build? Install straight from source:
uvx --from git+https://github.com/hbmartin/pyldraw3-tui pyldraw3-tui
uv tool install git+https://github.com/hbmartin/pyldraw3-tui
Usage
pyldraw3-tui [FILE]
With no argument it opens on the Catalog; given a .ldr/.mpd path it opens on the Model
view for that file. Switch modes in-app via the two top tabs: Catalog and Model.
Features
- Look up part codes — find a part's code/description fast to paste into scripts or
.ldrfiles. - Explore the catalog — browse categories and minifig sections to discover parts.
- Inspect a part — metadata, palette swatches, and a drillable sub-part reference tree.
- Browse a model file — open a
.ldr/.mpdand read its pieces, summary stats, and bill of materials.
First run
On launch the app reads your pyldraw3 configuration. If no LDraw library is found on disk, a guided setup screen offers to download the library (~80 MB), point your configuration at it, and generate the parts index. If the index is missing or stale it is rebuilt automatically with a progress indicator — the first build takes a few seconds; later launches are instant.
Everything lives under your platform's standard directories (resolved by platformdirs):
| What | macOS | Linux |
|---|---|---|
Config file (config.yml) |
~/Library/Application Support/pyldraw3/ |
~/.config/pyldraw3/ |
| LDraw library (download) | ~/Library/Caches/pyldraw3/ |
~/.cache/pyldraw3/ |
| Generated parts index | ~/Library/Application Support/pyldraw3/generated/ |
~/.local/share/pyldraw3/generated/ |
The exact library and index paths are recorded in config.yml; the values above are the defaults.
Windows uses the equivalent %LOCALAPPDATA% locations.
Key bindings
Navigation
| Key | Action |
|---|---|
↑/↓, k/j |
Move within the focused list/tree |
h/l |
Collapse/expand tree nodes |
Tab / Shift+Tab |
Cycle focusable panes |
Enter |
Open/drill selection |
/ |
Focus the live filter box |
Actions
| Key | Action |
|---|---|
y / Y |
Yank code / chooser (description, import path) |
o |
Open selected part on ldraw.org |
e |
Export Python snippet (import / Piece(...) / bare code) |
Global
| Key | Action |
|---|---|
1 / 2 |
Switch to Catalog / Model tab |
: |
Command palette (jump to part, open model, copy BOM, …) |
Ctrl+T |
Toggle light/dark theme |
? |
Help (full key reference) |
q / Ctrl+C |
Quit |
Full mouse support comes for free with Textual.
Contributing
Contributions are welcome! See CONTRIBUTING.md for local setup, the check suite, and the snapshot-testing workflow. Please also review our Code of Conduct.
License
Distributed under the GPL-3.0-or-later license. See LICENSE.txt for details.
LEGO® is a trademark of the LEGO Group, which does not sponsor, authorize, or endorse this project. LDraw™ is a trademark of the Estate of James Jessiman.
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
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 pyldraw3_tui-0.1.0.tar.gz.
File metadata
- Download URL: pyldraw3_tui-0.1.0.tar.gz
- Upload date:
- Size: 37.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fc060361122f0199202607d2a1c1ebe38c1ae0ddeb5b08726392069f0322a04
|
|
| MD5 |
6280bf6de8d3bb86be28673f9fa5f32e
|
|
| BLAKE2b-256 |
8e78abf3966f0c1f36845b3fabe0e2e1d7e517a880d4a5298bd97900457bba1d
|
Provenance
The following attestation bundles were made for pyldraw3_tui-0.1.0.tar.gz:
Publisher:
publish.yml on hbmartin/pyldraw3-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyldraw3_tui-0.1.0.tar.gz -
Subject digest:
2fc060361122f0199202607d2a1c1ebe38c1ae0ddeb5b08726392069f0322a04 - Sigstore transparency entry: 2129915482
- Sigstore integration time:
-
Permalink:
hbmartin/pyldraw3-tui@aa80c2506b8e412564a97b63ca29ef95fa6b4912 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/hbmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa80c2506b8e412564a97b63ca29ef95fa6b4912 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyldraw3_tui-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyldraw3_tui-0.1.0-py3-none-any.whl
- Upload date:
- Size: 49.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d1b3f15b046da5a24355d18d69260667181428df44e6f3eb2dce0d1867791d9
|
|
| MD5 |
45963cfdb144015113efaadf187293f1
|
|
| BLAKE2b-256 |
9871ea83e4d4470f0de8ea21dd134e49114c0cebdd361bfd194ece32055f0b2c
|
Provenance
The following attestation bundles were made for pyldraw3_tui-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on hbmartin/pyldraw3-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyldraw3_tui-0.1.0-py3-none-any.whl -
Subject digest:
4d1b3f15b046da5a24355d18d69260667181428df44e6f3eb2dce0d1867791d9 - Sigstore transparency entry: 2129915501
- Sigstore integration time:
-
Permalink:
hbmartin/pyldraw3-tui@aa80c2506b8e412564a97b63ca29ef95fa6b4912 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/hbmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa80c2506b8e412564a97b63ca29ef95fa6b4912 -
Trigger Event:
release
-
Statement type: