A rough-draft Python client and engine for playing DragonRealms. The goal is something lich-shaped — a middleman between the game server and whatever front end you want to attach — but written in Python, with Python scripting, and more modularity where that's easy to get.
This is a hobby project. It is not a drop-in lich replacement and it is not trying to be. If you want a polished TUI today, go use Profanity. If you want a polished modern front end, go use Frostbite. If you want to tinker with Python wrapping a MUD connection, stay.
Related reading: Pylanthia.
- core — the engine / middleman. Handles the telnet connection to Simutronics, feeds incoming bytes through an XML parser, strips game XML out of the text stream, and dispatches input/output. See client/core.py and client/xml_data.py.
- login — handles the SAL-style login handshake to get a game connection. See client/login.py. Drop a
secrets.pynext to client/secrets-example.py to supply credentials. - gui — a PyQt6 front end. A main text output, a docked input line, a file/view menu. Reminiscent of the pre-Wizard/Stormfront AOL Gemstone clients. Currently the primary test bench for
core. See client/gui/client_gui.py. - tui — a non-working draft of a terminal front end. Framework choice is still up in the air. See client/tui/.
Requires Python 3.10–3.12. Python 3.13+ will not work because client/login.py imports telnetlib, which was removed from the stdlib in 3.13.
This project is a member of the root uv workspace. From the repo root:
uv sync # installs revenant-client + dev tools into .venvDependencies are declared in pyproject.toml — currently just pyqt6 and pyyaml, with black, flake8, pre-commit, and pytest in the dev dependency group.
There is no CLI entry point yet — the GUI is started via if __name__ == "__main__" at the bottom of client/gui/client_gui.py:
uv run python -m client.gui.client_guiYou will need a working secrets.py (copy from client/secrets-example.py) for login to succeed. A CLI wrapper is on the TODO list.
From this directory:
uv run pytestThere is a small XML parser test suite in tests/test_xml_parser.py backed by a captured login session in tests/login-sample.log.
client/
├── client/
│ ├── core.py # Engine: connection, reactor loop, XML parsing
│ ├── login.py # SAL login handshake
│ ├── xml_data.py # Game XML parser / text stripper
│ ├── client_logger.py # Logging mixin
│ ├── logging_config.yaml
│ ├── gui/ # PyQt6 front end
│ └── tui/ # (draft) terminal front end
├── notebooks/ # Scratch notebooks
├── tests/
└── pyproject.toml