Metadata-Version: 2.4
Name: lispyn
Version: 0.32.0a1
Summary: A new way to write and run machine-learning experiments with Hy, PyTorch and Jupyter.
Author: Eduardo J. Barrios
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/edujbarrios/lispyn
Project-URL: Repository, https://github.com/edujbarrios/lispyn
Project-URL: Issues, https://github.com/edujbarrios/lispyn/issues
Project-URL: Documentation, https://github.com/edujbarrios/lispyn/blob/main/supported_macros/README.md
Keywords: lisp,hy,jupyter,pytorch,notebooks,machine-learning
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: hy<2.0,>=1.0
Requires-Dist: nbformat<6,>=5.8
Requires-Dist: packaging>=23
Requires-Dist: nbclient<1,>=0.9
Requires-Dist: ipykernel>=6
Requires-Dist: matplotlib>=3.8
Provides-Extra: notebook
Requires-Dist: nbclient<1,>=0.9; extra == "notebook"
Requires-Dist: ipykernel>=6; extra == "notebook"
Provides-Extra: data
Requires-Dist: pandas>=2; extra == "data"
Provides-Extra: vision
Requires-Dist: torch; extra == "vision"
Requires-Dist: torchvision; extra == "vision"
Requires-Dist: pillow; extra == "vision"
Provides-Extra: audio
Requires-Dist: torch; extra == "audio"
Requires-Dist: torchaudio; extra == "audio"
Requires-Dist: torchcodec; extra == "audio"
Provides-Extra: text
Requires-Dist: torch; extra == "text"
Provides-Extra: peft
Requires-Dist: peft>=0.15; extra == "peft"
Requires-Dist: transformers<5,>=4.45; extra == "peft"
Provides-Extra: plots
Requires-Dist: matplotlib>=3.8; extra == "plots"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: nbclient<1,>=0.9; extra == "dev"
Requires-Dist: ipykernel>=6; extra == "dev"
Dynamic: license-file

# Lispyn

**Write research experiments in Hy (Lisp for Python), then run them directly or turn them into standard Jupyter notebooks.**

Lispyn adds reusable macros to existing **PyTorch, Matplotlib, pandas and NumPy** workflows. It does not replace those libraries or lock you into a training framework.

[![PyPI version](https://img.shields.io/pypi/v/lispyn?label=PyPI%20version)](https://pypi.org/project/lispyn/) [![CI on main](https://github.com/edujbarrios/lispyn/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/edujbarrios/lispyn/actions/workflows/tests.yml?query=branch%3Amain) [![Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)

## Why use it for research?

- **Less boilerplate:** repeatable experiment parameters, training, data checks, splits, cross-validation, metrics and plotting.
- **One source, three modes:** execute Hy directly; compile notebook cells without running them; or run and save the notebook with outputs.
- **Inspectable research artifacts:** ordinary Python cells, provenance, reports and optional integrity-checked experiment archives.

These tools help organize research; they do not guarantee reproducibility or scientifically valid results.

## Install

```bash
pip install lispyn
```

Hy, notebook execution and Matplotlib are included. NumPy comes with Matplotlib; for pandas use `pip install "lispyn[data]"`. **PyTorch is installed separately** for the appropriate [CPU/GPU build](https://pytorch.org/get-started/locally/).

## How it works: three ways to run Hy

All three commands use the same [runnable `examples/hello.hy`](examples/hello.hy). Clone the examples first:

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

**1. Run Hy directly** — prints to the terminal, no notebook:

```bash
lispyn run examples/hello.hy
```

**2. Build a Jupyter notebook** — creates `hello.ipynb` with Python/Markdown cells. **Nothing is executed**:

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

**3. Build and execute a Jupyter notebook** — creates `hello-executed.ipynb` and **saves the executed cells** and their outputs:

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

Check for `2 + 3 + 5 = 10` and `Lispyn checks passed!` in the terminal or executed notebook. Hy macros compile into regular Python notebook cells. Only run or compile **trusted Hy source**; macros are not sandboxed.

## Complete macro catalog

**[All 49 macros: syntax, arguments, dependencies and Hy examples](supported_macros/README.md)**

The catalog explains the available **PyTorch** training and evaluation, **Matplotlib** charts, **pandas** table operations, **NumPy** array checks, notebook generation, reports and experiment comparisons. New: [data-quality profiles](examples/data_profiles.hy). See also the [PyTorch quickstart](examples/quickstart.hy) and [executed notebook gallery](example_generated_notebooks/).

For native PyTorch, try `lispyn execute examples/quickstart.hy` after installing PyTorch.

From a source checkout, `pip install -r requirements.txt` installs an optional full research environment.

*Created by Eduardo J. Barrios · [Apache-2.0](LICENSE) · [Citation](CITATION.cff) · Experimental alpha software.*
