Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Lispyn — Realización de notebooks de IA

Create AI notebooks with Hy (Lisp for Python): run scripts, generate Jupyter notebooks or save executed results.

Lispyn provides macros for PyTorch, NumPy, pandas and Matplotlib while keeping your Python libraries and models.

PyPI version CI on main Apache-2.0

Why use Lispyn for AI notebooks?

Less boilerplate. For example, the real PyTorch quickstart uses a macro to create separate train, validation and held-out test subsets:

(setv [training validation held-out]
  (train-val-test dataset :validation-fraction 0.25
    :test-fraction 0.25 :seed seed))

Catch invalid data early. The runnable NumPy/pandas example checks shape and finite values without writing a manual validation loop:

(require lispyn.macros [assert-finite assert-shape])
(import numpy :as np)
(import pandas :as pd)

(setv features (np.array [[1.0 2.0] [3.0 4.0]]))
(assert-shape features [2 2] :name "features")
(assert-finite features :name "features")

Check class imbalance before training. The runnable label balance example summarizes a classification dataset and plots its class counts:

(require lispyn.macros [label-balance plot-label-balance])
(setv labels ["cat" "cat" "cat" "dog" "dog" "bird"])
(setv report (label-balance labels :title "Training label distribution"))

Prepare a balanced classification loss. Use class-weights with an explicit class order matching your model's encoded target indices; it returns inverse-frequency weights that can be passed to PyTorch. See the label balance example and macro reference.

One source, three modes. The same hello.hy can run in a terminal, become an unexecuted notebook, or produce a notebook with saved outputs. See the three commands below.

Inspectable AI notebook outputs. The quickstart renders a report from actual PyTorch training results, which can be reviewed in the executed notebook:

(require lispyn.macros [report-run narrate metric-table])
(import lispyn.training [evaluate-metrics])
(report-run run :title "PyTorch baseline · recorded metrics")

These examples simplify AI notebook development; Lispyn does not guarantee model quality, reproducibility or valid evaluations.

Install

pip install lispyn

Hy, Jupyter execution and Matplotlib are included. NumPy is available through Matplotlib; for pandas install pip install "lispyn[data]". PyTorch is installed separately for your CPU/GPU setup.

How it works: three ways to run Hy

Get the hello.hy example (no dataset, no PyTorch):

git clone https://github.com/edujbarrios/lispyn.git
cd lispyn

1. Run the Hy file — terminal output, no notebook:

lispyn run examples/hello.hy

2. Generate a Jupyter notebook — hello.ipynb, Nothing is executed:

lispyn build examples/hello.hy -o hello.ipynb

3. Generate and execute the notebook — hello-executed.ipynb saves the executed cells and outputs:

lispyn execute examples/hello.hy -o hello-executed.ipynb

Check for 2 + 3 + 5 = 10 and Lispyn checks passed!. Building compiles Hy into ordinary Python/Markdown notebook cells without executing it. Only compile trusted Hy: macros are not sandboxed.

All macros and examples

Full reference: 54 macros, arguments, dependencies and Hy examples — grouped by PyTorch, Matplotlib, pandas, NumPy, notebook authoring, classification and AI experiment reporting.

More runnable sources: PyTorch quickstart (try lispyn execute examples/quickstart.hy), data profiles and input assertions and label balance. A cloned repository also offers pip install -r requirements.txt for an optional full AI development environment.

Created by Eduardo J. Barrios · Apache-2.0 · Citation · Experimental alpha software.

Metadata

Release files for lispyn 0.35.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lispyn 0.35.0a1
File Size Uploaded Provenance Actions
lispyn-0.35.0a1.tar.gz 146.4 kB With provenance Details for lispyn-0.35.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lispyn 0.35.0a1
File Interpreter ABI Platform Actions
lispyn-0.35.0a1-py3-none-any.whl Python 3 none any Details for lispyn-0.35.0a1-py3-none-any.whl

Total release size: 240.0 kB

Release files / lispyn-0.35.0a1.tar.gz

Download URL lispyn-0.35.0a1.tar.gz
Size 146.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5b557ac65ecedff461b775508ad004fdf70cc5e400c864953fa419a0eb79732a
BLAKE2b-256 checksum
How to use checksums
b1d86166a771829c96a6e67f2a7506ac0fb3e2c5b1c426a06e3b429fe7dc67d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / lispyn-0.35.0a1-py3-none-any.whl

Download URL lispyn-0.35.0a1-py3-none-any.whl
Size 93.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab54f530ffc67a540fed2094b259890c30a7cf7ae393d15a41b2c2f85d0d4878
BLAKE2b-256 checksum
How to use checksums
f5ee5ae13c58c6ff8634254b4c4e44f6ed3dee4ace03da1d7c842e0b046a52b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for lispyn 0.35.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lispyn-0.35.0a1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page