A minimal Hy utility library, using mostly the standard libraries.
Project description
🦑 Hyjinx 🔬
Functions and macros for modern living in the Hy REPL.
Compatible with Hy ≥ 1.2.0 · Python ≥ 3.13
Hyjinx is a utility library for Hy. When a module stabilises, it gets spun out into its own package (e.g. beautifhy).
Modules
| Module | Description | Dependencies |
|---|---|---|
lib |
String/file/OS utilities, JSON I/O, hashing | toolz |
result |
Result type (ok/err) with threading macros |
— |
macros |
defmethod, defstruct, when-let, lmap, etc. |
toolz |
actors |
Async actor model with defactor macro |
— |
api |
Static API surface inspection (no imports, no side effects) | — |
source |
Code inspection, display, and editing | pygments, beautifhy |
hjx_inspect |
Hy-aware inspect module |
multimethod |
crypto |
ECDSA signing and password hashing | ecdsa |
mat |
NumPy pretty-printing for humans | numpy, colorist |
llm |
Discuss code with LLMs (OpenAI, Anthropic, TabbyAPI) | openai, anthropic |
wire |
ZMQ message framing | zmq, msgpack, zstandard |
zmq_client |
Lazy Pirate ZMQ client | zmq |
zmq_server |
Lazy Pirate ZMQ server | zmq |
screen |
ncurses wrapper | — |
docs |
Offline Hy/Hyrule/Toolz documentation | — |
hyrc |
REPL startup configuration | — |
mail |
Email sending | — |
cli |
Command-line interface | click, pygments |
CLI
$ hyjinx where hyjinx.macros.defmethod
/path/to/hyjinx/macros.hy:94
$ hyjinx where json.dumps --json
{"line": 184, "module": "json", "file": "...", "language": "python", "extension": "py"}
$ hyjinx dir hyjinx.result
hyjinx/result.hy [14 definitions]
defn ok(value)
defn err(error-type, message, context)
defn as-result(x)
mac result->(expr, forms)
mac result->>(expr, forms)
mac let-result(bindings, body)
mac match-result(result, ok-sym, ok-body, err-sym, err-body)
mac try-result(body)
defn raise-if-err(result)
defn unwrap(result)
defn unwrap-or(result, default)
defn map-ok(f, result)
defn map-err(f, result)
defn collect-results(results)
$ hyjinx dir hyjinx.lib --kind defn --no-params
hyjinx/lib.hy [60 definitions]
defn mreload
defn sync-await
defn compose
...
$ hyjinx source hyjinx.api.format-surface --no-highlight
(defn format-surface [defs * [show-params True] [show-line False]]
...)
$ hyjinx doc hyjinx.api.api-surface
Return a list of definition dicts for a source file.
Each dict has keys: kind, name, params, line.
No imports are performed — purely static analysis.
The dir command uses static analysis — it parses source files without importing them, so it never triggers side effects (DB connections, GPU init, etc.).
Install
pip install hyjinx
Optional dependencies:
pip install hyjinx[zmq] # ecdsa, pyzmq, zstandard, msgpack
pip install hyjinx[llm] # openai, anthropic
pip install hyjinx[dev] # pytest + all optional dependencies
For offline Hy/Hyrule/Toolz documentation:
hy -m hyjinx.docs
For in-terminal sixel rendering of LaTeX in LLM replies, install pdflatex, dvipng, and img2sixel, and use a sixel-capable terminal.
Hylights
defmethod— polymorphic type dispatch viamultimethod- Result type —
ok/errwithresult->,let-result,match-result,try-result defstruct— frozen dict-like records- Static API inspection —
api-surfaceparses Hy/Python source without importing - Hy-aware
inspect—getsource,getsourcefilethat handle macros and multimethods - LLM integration — discuss code with ChatGPT, Claude, or local models
- ZMQ lazy pirate — reliable RPC client/server with automatic retries
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 hyjinx-1.2.5.tar.gz.
File metadata
- Download URL: hyjinx-1.2.5.tar.gz
- Upload date:
- Size: 60.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bba69d029b06ebe60d7f6aff65f7a6e547b5ff38fa1d2709a80de23be654f7e
|
|
| MD5 |
f8a4d8d8b9f069ea82260f351a3c15e0
|
|
| BLAKE2b-256 |
c58224390a393f7a165c0a3da43ba5134d1e66b12b67c7131ed4bd2f8ad034d8
|
File details
Details for the file hyjinx-1.2.5-py3-none-any.whl.
File metadata
- Download URL: hyjinx-1.2.5-py3-none-any.whl
- Upload date:
- Size: 57.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0832681d18e04710abd890509dc841968b83f6604609c70a0ebb96f604423bab
|
|
| MD5 |
8b7e81e7e3265d8d978e3900a3fe45b0
|
|
| BLAKE2b-256 |
5e9b9ee1f1179d030b4091918c179da2b7e241875b7fe0912adb15b4833626b2
|