{"id":23023,"library":"zope-tales","title":"zope.tales","description":"Implementation of the TAL Expression Syntax (TALES) used by Zope Page Templates (ZPT/TAL). Version 7.0 supports Python >=3.9. Released on an as-needed cadence by the Zope Foundation.","status":"active","version":"7.0","language":"python","source_language":"en","source_url":"https://github.com/zopefoundation/zope.tales","tags":["zope","tales","tal","templates","expressions"],"install":[{"cmd":"pip install zope.tales","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core dependency for interface definitions","package":"zope.interface","optional":false},{"reason":"Used for proxy support in path expressions","package":"zope.proxy","optional":false},{"reason":"Full Zope application server (not required for standalone use)","package":"Zope","optional":true}],"imports":[{"note":"Standard way to obtain a TALES engine instance","symbol":"getEngine","correct":"from zope.tales.engine import getEngine"},{"note":"Incorrect import path; ExpressionEngine is in the engine module.","wrong":"from zope.tales import ExpressionEngine","symbol":"ExpressionEngine","correct":"from zope.tales.engine import ExpressionEngine"},{"note":"TALESError is defined in the expressions module, not top-level.","wrong":"from zope.tales import TALESError","symbol":"TALESError","correct":"from zope.tales.expressions import TALESError"}],"quickstart":{"code":"from zope.tales.engine import Engine\ne = Engine()\ncontext = {'name': 'World'}\nresult = e.evaluate('Hello, ${name}!', context)\nprint(result)  # outputs: Hello, World!","lang":"python","description":"Basic example: creates a TALES engine, sets a context variable, evaluates a simple expression."},"warnings":[{"fix":"Upgrade to Python 3.9+ or pin zope.tales to version 6.x.","message":"Python 3.9 minimum in version 7.0; older Python versions are no longer supported.","severity":"breaking","affected_versions":">=7.0"},{"fix":"Use the 'context' argument instead.","message":"The 'namespaces' argument in Engine.evaluate() has been deprecated since 6.0 and may be removed.","severity":"deprecated","affected_versions":">=6.0"},{"fix":"Use slash (/) for path traversal: 'request/form' instead of 'request.form'.","message":"TALES uses a custom expression parser; variable names with dots (e.g., 'request.form') require explicit bracket notation like 'request/ form' or using the 'path:' prefix.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: pip install zope.tales","cause":"Package not installed or installed under a different name.","error":"ModuleNotFoundError: No module named 'zope.tales'"},{"fix":"Use: from zope.tales.engine import ExpressionEngine","cause":"Incorrect import path: ExpressionEngine is in the engine submodule.","error":"ImportError: cannot import name 'ExpressionEngine' from 'zope.tales'"},{"fix":"Ensure expressions use correct TALES syntax: use ${...} for variables, / for path segments, and check parentheses.","cause":"Invalid expression syntax (e.g., missing closing brace, wrong path separator).","error":"zope.tales.expressions.TALESError: ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}