--- id: etuples version: "0.3.10" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # etuples — Python S-expression emulation using tuple-like objects. License: permissive · Maintenance: aging · Downloads: 1.3M/mo ## 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 above — 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 pip install etuples uv add etuples 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_current - Install friction: low - Maintenance: aging - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags s-expression tuples python, expression evaluation caching, lisp-like tuple objects, symbolic computation tuples, operator dispatch tuples, etuple expression trees, functional tuple evaluation, symbolic-computation, expression-trees, meta-programming [View on SkillFed](https://skillfed.io/packages/etuples) · [View on PyPI](https://pypi.org/project/etuples/)