--- id: diastatic-malt version: "2.15.3" license: Apache License 2.0 license_treatment: permissive maintenance: active --- # diastatic-malt — A library for Python operator overloading License: permissive · Maintenance: active · Downloads: 330.0K/mo ## What it is and what it does DiastaticMalt is a Python metaprogramming library that performs source-to-source code transformations and operator overloading, including the ability to overload built-in Python keywords. It is derived from TensorFlow's AutoGraph module (under Apache 2.0 license) but operates as a standalone library without requiring TensorFlow as a dependency. The library transforms regular Python code into alternative forms optimized for specific use cases, such as program capture or specialized execution contexts. The package is lightweight, depending only on termcolor for output formatting, and targets modern Python versions (3.9+). It is maintained by the PennyLane team and classified as Production/Stable, making it suitable for use in projects that need fine-grained control over how Python code is executed or analyzed at runtime. Use it for: - Transform Python code for specialized execution contexts without depending on the full TensorFlow library. - Implement custom operator overloading to intercept and modify how Python expressions are evaluated. - Build program capture or tracing systems that need to intercept keyword behavior. - Create domain-specific languages or embedded DSLs that require fine-grained control over Python semantics. - Develop debugging or profiling tools that need to instrument Python code at the source level. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. DiastaticMalt performs source-to-source transformations and operator overloading in Python, including overloading of built-in keywords, to convert regular Python code into alternative forms suited for specific purposes like program capture. Yes, if you need source-to-source code transformation or operator overloading in Python. Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. The main consideration is whether your use case actually requires the transformation capabilities it provides—it is a specialized tool, not a general utility. ## Install pip install diastatic-malt uv add diastatic-malt poetry add diastatic-malt ## Installing diastatic-malt Before you install: Low friction: pure Python wheel with a single runtime dependency (termcolor). Active maintenance with last commit 2026-03-18 and classified as Production/Stable. License in practice: Apache License 2.0 is permissive, allowing commercial and private use with minimal restrictions. You must include a copy of the license and state significant changes, but can use the code freely. Quickstart: pip install diastatic-malt import diastatic_malt # Use the library's transformation capabilities on your Python code Requires Python 3.9 or later (supports 3.9, 3.10, 3.11). Verify before relying: - What specific transformation capabilities are available beyond operator overloading and keyword overloading. - Whether the AutoGraph functionality ported from TensorFlow is feature-complete or has limitations. - Real-world performance characteristics and overhead of the transformations. ## Package facts - License: Apache License 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 330.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python source code transformation, operator overloading library, python keyword overloading, autograph without tensorflow, code metaprogramming python, ast transformation tool, program capture python, metaprogramming, code-transformation, operator-overloading [View on SkillFed](https://skillfed.io/packages/diastatic-malt) · [View on PyPI](https://pypi.org/project/diastatic-malt/)