Skip to main content

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 and anthropic 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


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.0.11.tar.gz (46.3 kB view details)

Uploaded Source

Built Distribution

hyjinx-1.0.11-py3-none-any.whl (49.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyjinx-1.0.11.tar.gz
  • Upload date:
  • Size: 46.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for hyjinx-1.0.11.tar.gz
Algorithm Hash digest
SHA256 5d1a06f4f20dfc53f106c1964c826deb08f8cb8fae286c1c6a57a7c0895e9703
MD5 596d4b46c1d80f7218ae992c784de0f7
BLAKE2b-256 94a93b1097963f01e1580e84255a6ca17b30748e556c1a39fccb95aeaea9a0c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyjinx-1.0.11-py3-none-any.whl
  • Upload date:
  • Size: 49.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for hyjinx-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 437468e3470ca30e04fa8b07bbb6f0d1117e1a1d672e11b12575293ace882b3c
MD5 a3e86fbd458eff2f9250d0675f6f44c0
BLAKE2b-256 41479ac9fc84e5481fa90b00cc703505bdab98e209cb7bc4c3f7a66545b464fa

See more details on using hashes here.

Supported by

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