Skip to main content

LisPython

PyPI version

LisPython is a Lisp-flavored syntax for Python with Lisp-style macros. Source files (.lpy) are transpiled to Python and executed on the standard CPython runtime.

Documentation

Full documentation lives at https://jetack.github.io/lispython/.

Quick Start

(import math)

(def area [r]
  (return (* math.pi (** r 2))))

(print (area 3))
lpy example.lpy

Installation

Using pip

pip install lispython

Manual Installation (for development)

uv sync # install dependencies
uv pip install -e . # for development

Contributors using git worktrees: run git config core.hooksPath .githooks once in the main checkout; see .githooks/README.md. This replaces .git/hooks, so hooks installed there stop running.

How to Run LisPython code

Run from source

lpy {filename}.lpy

Run REPL

lpy
# or
lpy -t # if you want to print python translation.

Show translation

l2py {filename}.lpy

Prints the translated Python to stdout. It does not execute the code.

Run Tests

# in project root directory
pytest
# or
lpy -m pytest

LSP Server

LisPython ships with a language server (lpy-lsp) that speaks LSP over stdio. It provides:

  • Diagnostics (parse / compile errors)
  • Completions (special forms, builtins, file/workspace symbols)
  • Hover documentation for special forms and builtins
  • Signature help for special forms and builtins
  • Document symbols and workspace symbol search
  • Go-to-definition, including across .lpy files in the workspace

nREPL Server

LisPython includes an nREPL server for REPL-driven development:

lpy --nrepl         # start on a random port
lpy --nrepl 7888    # start on a specific port

While running, the server writes its port to .nrepl-port in the working directory for editor auto-discovery.

The server accepts newline-delimited JSON over TCP and supports:

  • eval — evaluate LisPython code, return value/stdout/error
  • load-file — load a .lpy file into the session
  • macroexpand — expand macros and return the result
  • complete — prefix and dot-completion from the live scope, with a kinds map (class/function/variable/macro/keyword)
  • docs — signature and docstring for a symbol
  • annotate — type tag (function/class/module/macro)

Editor setup

VS Code

Install the LisPython extension. It connects to both LSP and nREPL automatically.

Emacs

Use lpy-mode. It provides nREPL integration (eval, completion, eldoc, macroexpand) and LSP via eglot.

Metadata

Release files for lispython 0.6.0

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

Source distribution (sdist)

Source distribution for lispython 0.6.0
File Size Uploaded Provenance Actions
lispython-0.6.0.tar.gz 234.8 kB Without provenance Details for lispython-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 338.8 kB

Release files / lispython-0.6.0.tar.gz

Download URL lispython-0.6.0.tar.gz
Size 234.8 kB
Tags Source
SHA-256 checksum
How to use checksums
99c8529cca3ad922457f8653fb174f99e66187b75fa6d1a548d08b70b4ee6f67
BLAKE2b-256 checksum
How to use checksums
6c0c69086f86aad7e8d760b02e4d68dd3ec618e74e6ac45b99e0175839333815
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / lispython-0.6.0-py3-none-any.whl

Download URL lispython-0.6.0-py3-none-any.whl
Size 104.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9caeef83419f1095e691092739cda9687c3681c412040c2ef2d8176f85d98884
BLAKE2b-256 checksum
How to use checksums
9efa9b48ac1e4f51b1b44f066a591525deb7713e7dd3a76883bb74fc264bab6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for lispython 0.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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