{"id":8792,"library":"yaql","title":"YAQL - Yet Another Query Language","description":"YAQL (Yet Another Query Language) is an embeddable and extensible Python query language designed to perform complex queries against arbitrary objects. It features a comprehensive standard library of querying functions and supports user-defined extensions. The current version is 3.2.0, actively maintained with infrequent releases, and it is distributed via PyPI.","status":"active","version":"3.2.0","language":"python","source_language":"en","source_url":"https://yaql.readthedocs.io/en/latest/","tags":["query language","data transformation","json","yaml","expression language"],"install":[{"cmd":"pip install yaql","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"wrong":"from yaql import YaqlFactory","symbol":"YaqlFactory","correct":"from yaql import YaqlFactory"}],"quickstart":{"code":"import yaql\nfrom yaql.factory import YaqlFactory\n\ndata_source = {\n    'customers': [\n        {'name': 'John Doe', 'age': 30, 'city': 'New York', 'orders': [{'id': 1, 'amount': 100}, {'id': 2, 'amount': 250}]},\n        {'name': 'Jane Smith', 'age': 24, 'city': 'London', 'orders': [{'id': 3, 'amount': 150}]},\n        {'name': 'Peter Jones', 'age': 35, 'city': 'New York', 'orders': []}\n    ]\n}\n\n# Create a YAQL engine\nengine = YaqlFactory().create()\n\n# Evaluate an expression to find customers in New York\nexpression = '$.customers.where($.city = \"New York\")'\nresult = engine(expression)(data=data_source)\nprint(f\"Customers in New York: {list(result)}\")\n\n# Evaluate an expression to get names of customers with orders\nexpression_with_orders = '$.customers.where($.orders.len() >= 1).select($.name)'\nresult_with_orders = engine(expression_with_orders)(data=data_source)\nprint(f\"Customers with orders: {list(result_with_orders)}\")","lang":"python","description":"This quickstart demonstrates how to initialize the YAQL engine, load a data source, and execute simple YAQL expressions to filter and select data. The `data` keyword argument is used to pass the input data to the engine."},"warnings":[{"fix":"Always treat data passed into YAQL expressions as immutable. If modifications are needed, ensure your custom YAQL functions return new, modified copies of the data instead of altering the originals in-place.","message":"YAQL is designed to keep input data unchanged. Functions that appear to modify data actually return an updated copy, preserving the original data. This design also contributes to its thread-safety. Directly modifying input data structures from within YAQL functions can lead to unexpected behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Structure your data to avoid ambiguity where 'not present' and 'null' have different semantic meanings, or implement custom YAQL functions or a custom context to handle explicit variable existence checks if required.","message":"There is no built-in syntax in YAQL to explicitly check if a variable exists versus being set to `null`. If a variable is not provided, it is implicitly assumed to be `null` when accessed. This can lead to ambiguity if you need to differentiate between a variable that doesn't exist and one that explicitly holds a `null` value.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to YAQL version 3.2.0 or later, as this specific issue was resolved. If upgrading is not immediately possible, consider transforming the array of dicts into a simpler, hashable structure before applying `distinct()` or similar operations, or implement a custom distinct function.","message":"Older versions of YAQL could raise a `YaqlEvaluationException: TypeError: unhashable type: 'dict'` when using methods like `distinct()` on an array of dictionaries. This was a bug related to how YAQL handled dictionary hashing within certain operations.","severity":"breaking","affected_versions":"< 3.2.0 (specifically fixed before or in 3.2.0)"}],"env_vars":null,"search_vec":"'3.2.0':46 'activ':47 'anoth':3,8 'arbitrari':25 'complex':22 'comprehens':30 'current':43 'data':60 'defin':40 'design':19 'distribut':55 'embedd':13 'express':64 'extens':15,41 'featur':28 'function':35 'infrequ':50 'json':62 'languag':5,10,18,59,65 'librari':32 'maintain':48 'object':26 'perform':21 'pypi':57 'python':16 'queri':4,9,17,23,34,58 'releas':51 'standard':31 'support':37 'transform':61 'user':39 'user-defin':38 'version':44 'via':56 'yaml':63 'yaql':1,6 'yet':2,7","created_at":"2026-04-16T17:04:00.992658+00:00","updated_at":"2026-04-16T17:04:00.992658+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpdx_u_pdl/venv/lib/python3.12/site-packages/yaql/__init__.py\", line 17, in <module>\n    from yaql.language import contexts\n  File \"/tmp/tmpdx_u_pdl/venv/lib/python3.12/site-packages/yaql/language/contexts.py\", l"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.2.0","cli_name":"","cli_version":null,"type":"library","homepage":"http://yaql.readthedocs.io","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/yaql/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}