skillfed

etuples

Python S-expression emulation using tuple-like objects.

etuples v0.3.10 1.3M downloads/30d#4,121 on PyPI25
Permissive license Apache-2.0 AGING released

What it is and what it does

etuples provides a Python implementation of S-expressions—a Lisp-like notation where code and data are both represented as nested lists—using tuple-like objects. Each etuple wraps an operator (typically a callable) and its operands, and can be evaluated to produce a result. The package caches evaluation results so repeated access to the same etuple returns the same cached object, and tuple operations like slicing preserve both the etuple structure and its cached evaluation.

The package is built on multipledispatch, allowing you to extend rator (operator extraction), rands (operand extraction), and apply (operation application) to work with custom types beyond built-in etuples. This makes it useful for symbolic computation, expression trees, and meta-programming tasks where you need to manipulate and evaluate nested function calls as first-class data structures.

Use it for:

  • Build symbolic computation systems where mathematical or logical expressions are data structures that can be inspected, transformed, and evaluated.
  • Implement expression trees for domain-specific languages or interpreters that need to represent and evaluate nested operations.
  • Create meta-programming tools that treat function calls as composable, cacheable objects rather than immediate evaluations.
  • Extend custom node types (like AST nodes) to work with a unified operator/operand extraction and application interface.
  • Prototype Lisp-like or functional programming patterns in Python while maintaining tuple compatibility.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides S-expression emulation using tuple-like objects that can be evaluated, cached, and extended with custom operators via multipledispatch.

Yes, if you need S-expression-like symbolic computation in Python. The package is lightweight, has no security vulnerabilities, and carries a permissive license. The aging maintenance status (396 days since last release) is a minor concern for a stable library, but the recent repository activity and lack of open issues suggest it is not abandoned. Install it for expression trees, symbolic manipulation, or meta-programming; skip it if you only need standard tuple operations.

Install

etuples on PyPI

pip

pip install etuples

uv

uv add etuples

poetry

poetry add etuples

Installing etuples

Before you install

Low friction: pure Python wheel with only two runtime dependencies (cons and multipledispatch). Last release was recent and the repository is actively maintained, though the project shows aging status with no release in the past 396 days.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects.

Quickstart

pip install etuples

from operator import add
from etuples import etuple

et = etuple(add, 1, 2)
print(et.evaled_obj)  # 3

Requires Python 3.9 or later; CPython and PyPy are both supported.

Verify before relying

  • Whether the caching mechanism scales well with deeply nested or large expression trees.
  • Performance characteristics compared to native Python evaluation for typical use cases.
  • Whether the multipledispatch extension system is documented with real-world examples beyond the basic Node case.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — cons, multipledispatch
Maintenance aging — 396 days since the last release
Last repo commit
First released
Downloads 1,278,094/month — #4,121 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: etuples-0.3.10-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

s-expression tuples pythonexpression evaluation cachinglisp-like tuple objectssymbolic computation tuplesoperator dispatch tuplesetuple expression treesfunctional tuple evaluation
symbolic-computationexpression-treesmeta-programming

More Software Development packages