Metadata-Version: 2.4
Name: hy-fancy-repl
Version: 1.2.1
Summary: A fancy Hy REPL.
Author-email: Ati Sharma <ati+hy-fancy-repl@agalmic.ltd>
License: MIT License
        
        Copyright (c) 2024 the authors.
        
        Permission is hereby granted, free of charge, to any person obtaining a
        copy of this software and associated documentation files (the "Software"),
        to deal in the Software without restriction, including without limitation
        the rights to use, copy, modify, merge, publish, distribute, sublicense,
        and/or sell copies of the Software, and to permit persons to whom the
        Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
        THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
        FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
        DEALINGS IN THE SOFTWARE.
        
Project-URL: Repository, https://github.com/atisharma/hy-fancy-repl
Keywords: hy,hylang,utilities,repl
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Lisp
Classifier: Programming Language :: Hy
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: hy>=1.2.0
Requires-Dist: hyrule>=1.0.1
Requires-Dist: beautifhy>=1.2.4
Requires-Dist: colorist>=1.8
Requires-Dist: prompt_toolkit>=3.0.52
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Dynamic: license-file

## 🦑 hy-fancy-repl

*A [Hy](https://hylang.org) enhanced REPL.*

Compatible with Hy 1.2.0 and later.


### Install

```bash
$ 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.

```bash
$ hy-repl
```

or

```bash
$ 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-history` by 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`:
```bash
$ HY_TRACEBACK_IGNORE="hy/repl.py,code.py" hy-fancy-repl
```

Or modify at runtime:
```python
from hy_fancy_repl.repl import TRACEBACK_IGNORE
# TRACEBACK_IGNORE is a tuple of file path suffixes to ignore
```


### Acknowledgements

The REPL uses [pygments](https://pygments.org/), [prompt-toolkit](https://python-prompt-toolkit.readthedocs.io/),
[colorist](https://jakob-bagterp.github.io/colorist-for-python/), and [Hy](https://hylang.org).


### Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and contribution guidelines.


### Docs

Try clicking below.

[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/atisharma/hy-fancy-repl)
