A minimal Hy utility library, using mostly the standard libraries.
Project description
🦑 Hyjinx
Functions and macros useful for modern living in the Hy REPL.
Compatible with Hy 0.29.0.
Hylights
- A Hy code beautifier and in-REPL syntax highlighting
- An
inspect
module that works like Python's, but also for Hy code - Pretty tracebacks with correct syntax highlighting for hy or python
- Print/get/edit source code of a function, module etc. (e.g.
(print-source hyjinx.lib.sieve)
- A sensible, lispy
defmethod
- In-repl code analysis and discussion using LLMs (e.g. for writing docstrings)
- In-repl syntax highlighting and latex rendering (for sixel-capable terminals) for LLM replies
- Numpy array pretty printing
- A zmq lazy pirate protocol
- A minimal ncurses class
Modules
-
hyjinx.lib: a smorgasbord of convenience functions.
-
hyjinx.source: live code inspection.
-
hyjinx.inspect: code inspection.
-
hyjinx.doc: peruse hy documentation.
-
hyjinx.screen: a convenient ncurses wrapper.
-
hyjinx.mat: numpy pretty-printing for humans. (requires numpy, jax optional)
-
hyjinx.[zmq_client, zmq_server, crypto, wire]: lazy-pirate zmq RPC architecture. (requires zmq, ecdsa, zstandard, msgpack)
-
hyjinx.llm: discuss code with a Large Language Model (AI). TabbyAPI, OpenAI-compatible and Claude are supported. (requires
openai
andanthropic
packages.)
Install
$ pip install -U hyjinx
or, with optional dependencies,
$ pip install -U hyjinx[zmq]
$ pip install -U hyjinx[llm]
To install offline hy/hyrule documentation,
$ hy -m hyjinx.docs
For syntax highlighting in the REPL, put
(import hyjinx.source [hylight]) (setv repl-output-fn hylight)
in your .hyrc.
See hyjinx.hyrc for example usage.
For in-terminal sixel rendering of latex in LLM replies, make sure pdflatex, dvipng and img2sixel are installed, and that you're using a sixel-capable terminal.
Optional dependencies
You can install with the [zmq]
option which also installs ecdsa, pyzmq and zstandard for the zmq server/client
You can install with the [llm]
option which also installs openai and lets you discuss code objects with ChatGPT or a locally-served LLM (via TabbyAPI or similar).
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
File details
Details for the file hyjinx-1.0.9.tar.gz
.
File metadata
- Download URL: hyjinx-1.0.9.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b9806faec9cf2b07aee13f3f3dd0ab26e3e97ae5e82eb8d0c382f2f2eec872c |
|
MD5 | c64631a04425f82c39b1c88858ea5a13 |
|
BLAKE2b-256 | 41f3252a7f66aed1e51988fb2ca064fb2e4887e570ed3a551c393044ac3e6434 |
File details
Details for the file hyjinx-1.0.9-py3-none-any.whl
.
File metadata
- Download URL: hyjinx-1.0.9-py3-none-any.whl
- Upload date:
- Size: 48.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1db46a44a17c965c3f169e9f560f66576e91f5b7e8b9f2368f609dd2ff2fc28 |
|
MD5 | fb630ec7afd9c253be630089a11d5822 |
|
BLAKE2b-256 | a5fc536ff71dd3df40302446a3daa74596f2e468f4524cf06938f0b38ab4e110 |