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)
  • 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
  • A sensible, lispy defmethod
  • 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)

  • 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.3.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

hyjinx-1.0.3-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyjinx-1.0.3.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for hyjinx-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ac5fb1793a6c1d294827f9e410563976308a03cd66ace0f2c233ffa259555b5b
MD5 684b676b56209b7fd24414d8f6e4d691
BLAKE2b-256 696ec907098f38b0afabf43d752d2c0a5d2704b23b3355e214aa369ccb46efeb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyjinx-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 46.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for hyjinx-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8f0a77af7e0a99871745ca0b85822e6a2e9a21bcd6c43b1ea4f39300e829b2b6
MD5 ca228445b69e080da1f4d75c656b1c6c
BLAKE2b-256 12e45c07d612c8a5b43cd43637eae634d3882c3de30c21bbe33947f13f88b591

See more details on using hashes here.

Supported by

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