A fancy Hy REPL.
Project description
🦑 hy-fancy-repl
A Hy enhanced REPL.
Compatible with Hy 1.2.0 and later.
Install
$ pip install -U hy-fancy-repl
The REPL
The REPL implements multi-line editing, completion, live input validation, live syntax highlighting, bracket matching, enhanced tracebacks, and interactive matplotlib plots.
$ hy-repl
or
$ hy-fancy-repl
Features
- Multi-line editing with smart indentation
- Syntax highlighting via Pygments
- Bracket matching that ignores brackets inside strings and comments
- Tab completion with Hy's native completer
- Live validation - shows a red 'x' when parentheses are unbalanced
- Enhanced tracebacks - shows syntax-highlighted source snippets
- Interactive matplotlib - async plot updates when available
- History persistence - saved to
~/.hy-historyby default
Environment Variables
The REPL's behaviour may be modified with the following environment variables:
| Variable | Description | Default |
|---|---|---|
HY_HISTORY |
Path to command history file | ~/.hy-history |
HY_LIVE_COMPLETION |
Enable live autocompletion dropdown | unset (off) |
HY_PYGMENTS_STYLE |
Pygments style for highlighting | lightbulb |
HY_VI_MODE |
Enable vi line-editing mode | unset (emacs) |
HY_TRACEBACK_IGNORE |
Comma-separated list of files to hide in tracebacks | sensible defaults |
Traceback Filtering
By default, the REPL hides infrastructure files in tracebacks to show your code. The default ignore list includes Hy internals, funcparserlib, and multimethod.
Override with HY_TRACEBACK_IGNORE:
$ HY_TRACEBACK_IGNORE="hy/repl.py,code.py" hy-fancy-repl
Or modify at runtime:
from hy_fancy_repl.repl import TRACEBACK_IGNORE
# TRACEBACK_IGNORE is a tuple of file path suffixes to ignore
Acknowledgements
The REPL uses pygments, prompt-toolkit, colorist, and Hy.
Contributing
See CONTRIBUTING.md for development setup and contribution guidelines.
Docs
Try clicking below.
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 hy_fancy_repl-1.2.1.tar.gz.
File metadata
- Download URL: hy_fancy_repl-1.2.1.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e1d4ad25e66a0300244f47e7d1dddab8a0b1710df7ebb95c7ccf3682d904a39
|
|
| MD5 |
f3c5c97da0b88b3d0b39f39565b356f7
|
|
| BLAKE2b-256 |
b73278e3142ccc7e92506dbf0fb0d5c0581ef815de2df20f5bf5239226eed51b
|
File details
Details for the file hy_fancy_repl-1.2.1-py3-none-any.whl.
File metadata
- Download URL: hy_fancy_repl-1.2.1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef015431478187e13d9d8ef1b206ac18c513f6253b151132a426e49192acfa96
|
|
| MD5 |
223fd54de45c112c5172fce00d9adfe4
|
|
| BLAKE2b-256 |
de526037427839ae8f9389b75992d0815f40d81d43dedcfc54e25c89f41a6155
|