{"id":22965,"library":"vtlengine","title":"VTL Engine - VTL Script Runner and Validator","description":"vtlengine is a Python library for running and validating VTL (Validation and Transformation Language) scripts. Version 1.6.8 supports Python >=3.9 and provides an interpreter with a pandas backend. It is released on PyPI with roughly monthly updates.","status":"active","version":"1.6.8","language":"python","source_language":"en","source_url":"https://github.com/Meaningful-Data/vtlengine","tags":["vtl","validation","transformation","pandas","data-engineering"],"install":[{"cmd":"pip install vtlengine","lang":"bash","label":"install from PyPI"}],"dependencies":[{"reason":"Required for DataFrame input/output.","package":"pandas","optional":false}],"imports":[{"note":"The main entry point.","wrong":null,"symbol":"Engine","correct":"from vtlengine import Engine"},{"note":"Used for parsing VTL scripts.","wrong":null,"symbol":"VtlListener","correct":"from vtlengine.parser import VtlListener"}],"quickstart":{"code":"from vtlengine import Engine\nimport pandas as pd\nfrom datetime import date\n\n# Sample data\ninput_ds = pd.DataFrame({\n    'id1': ['A', 'B'],\n    'id2': ['X', 'Y'],\n    'meas1': [10, 20],\n    'meas2': [5.5, 7.2]\n})\n\n# Define VTL script\nvtl_script = \"\"\"\ndefine operator mul(a, b) returns c\ntr := a * b / 2\nend operator\n\"\"\"\n\n# Initialize engine\nengine = Engine()\n\n# Run VTL script with datasets\nresult = engine.run(vtl_script, datasets={'input_ds': input_ds})\nprint(result['output_ds'])\n","lang":"python","description":"Demonstrates basic VTL script execution using the Engine class with pandas DataFrames."},"warnings":[{"fix":"Always use backend='pandas' or omit the parameter.","message":"The 'pandas' backend is the default and only supported backend. Using 'pandas' as the backend parameter is required; omitting it uses pandas, but explicitly passing other backends (e.g., 'spark') will raise an error.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use ISO 8601 format (default) or the new custom format.","message":"The legacy time period representation (time_period_output_format='legacy') was added in 1.6.0 but is deprecated and will be removed in a future version.","severity":"deprecated","affected_versions":"1.6.0 - 1.6.8"},{"fix":"Define DataStructure or ensure DataFrame columns match exactly.","message":"DataFrame columns not matching the DataStructure (if provided) will raise an error since v1.6.4. Ensure column names and types align exactly.","severity":"gotcha","affected_versions":">=1.6.4"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Check the VTL syntax and available operators in the official documentation.","cause":"The VTL script references an operator or function that is not implemented or misspelled.","error":"vtlengine.exceptions.VTLSemanticError: Operator '...' not defined"},{"fix":"Validate the script using Engine.from_string() and review the error line.","cause":"Invalid VTL syntax, often missing semicolons or incorrect parentheses.","error":"vtlengine.exceptions.VTLSyntaxError: line X:Y mismatched input '...' expecting ..."},{"fix":"Instantiate Engine() without arguments: engine = Engine()","cause":"The Engine constructor does not accept a 'backend' parameter anymore (if using old API).","error":"TypeError: __init__() got an unexpected keyword argument 'backend'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}