Skip to main content

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 via multimethod
  • Result typeok/err with result->, let-result, match-result, try-result
  • defstruct — frozen dict-like records
  • Static API inspectionapi-surface parses Hy/Python source without importing
  • Hy-aware inspectgetsource, getsourcefile that 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hyjinx-1.3.0.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hyjinx-1.3.0-py3-none-any.whl (57.0 kB view details)

Uploaded Python 3

File details

Details for the file hyjinx-1.3.0.tar.gz.

File metadata

  • Download URL: hyjinx-1.3.0.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

Hashes for hyjinx-1.3.0.tar.gz
Algorithm Hash digest
SHA256 b050db7da360850e3c1d87dd37ac39614962f26220bd2509b39b4cb714a12aef
MD5 e9eed9345c82c441ec844a798569e7e2
BLAKE2b-256 5fb33140b58a7985954308dc91b32e12fc4424041c02febd546ba393335166cf

See more details on using hashes here.

File details

Details for the file hyjinx-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: hyjinx-1.3.0-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

Hashes for hyjinx-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a738029821081d13789c52ed268670c3538b9aba8385fe439466efb80bb3995
MD5 cbb9c3007d36df69d29c3afdd74e2f91
BLAKE2b-256 fc866dea2e9c10aeb209d2fda7aad47143bea76deb9a8766c8bc3cafab4042e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page