{"id":27195,"library":"odata-query","title":"OData Query Parser and Transpiler","description":"A Python library for parsing OData query strings and transpiling them into SQL or other formats. Current version 0.10.0, supports Python 3.7+ (<4.0). Releases are infrequent with minor updates.","status":"active","version":"0.10.0","language":"python","source_language":"en","source_url":"https://github.com/davatron5000/odata-query","tags":["odata","query","parser","sql","transpiler"],"install":[{"cmd":"pip install odata-query","lang":"bash","label":"Latest release"}],"dependencies":[{"reason":"Used for parsing OData grammar","package":"lark-parser","optional":false}],"imports":[{"wrong":"from odata_query import ODataQuery","symbol":"ODataQuery","correct":"import odata_query"}],"quickstart":{"code":"from odata_query import ODataQuery\n\n# Parse an OData query string\nquery = ODataQuery(\"$filter=Name eq 'Alice'&$top=10&$orderby=Age desc\")\n\n# Access parsed components\nprint(query.filter)   # Name eq 'Alice'\nprint(query.top)      # 10\nprint(query.orderby)  # Age desc\n\n# Transpile to SQL (experimental)\nfrom odata_query.transpiler import SqlTranspiler\ntranspiler = SqlTranspiler()\nsql = transpiler.transpile(query)\nprint(sql)\n# Output: SELECT * FROM table WHERE Name = 'Alice' ORDER BY Age DESC LIMIT 10","lang":"python","description":"Parse an OData query string and optionally transpile to SQL."},"warnings":[{"fix":"Use SqlTranspiler to get WHERE, ORDER BY, LIMIT clauses, then combine with your own SELECT/FROM.","message":"The library does not build full SQL queries; SqlTranspiler only handles filter, orderby, top, skip. You must provide the SELECT and FROM parts manually.","severity":"gotcha","affected_versions":"<=0.10.0"},{"fix":"To access the parsed AST, use query.filter_ast, query.top_ast, etc. (attributes ending with _ast).","message":"ODataQuery object attributes (filter, top, etc.) are strings, not structured objects. Do not expect them to be parsed into AST nodes by default.","severity":"gotcha","affected_versions":"<=0.10.0"},{"fix":"Check the documentation for the latest transpilation API. Consider contributing to the library if you rely on this.","message":"The 'SqlTranspiler' class is experimental and may change in future versions.","severity":"deprecated","affected_versions":"0.9.0 - 0.10.0"},{"fix":"Sanitize or limit OData query functionality before transpiling. Check the source for supported functions.","message":"Filter expression strings may use OData functions like 'contains', 'startswith', but SqlTranspiler may not support all of them. Unsupported functions cause a NotImplementedError.","severity":"gotcha","affected_versions":"<=0.10.0"}],"env_vars":null,"search_vec":"'0.10.0':24 '3.7':27 '4.0':28 'current':22 'format':21 'infrequ':31 'librari':8 'minor':33 'odata':1,11,35 'pars':10 'parser':3,37 'python':7,26 'queri':2,12,36 'releas':29 'sql':18,38 'string':13 'support':25 'transpil':5,15,39 'updat':34 'version':23","created_at":"2026-05-01T17:44:59.915331+00:00","updated_at":"2026-05-01T17:44:59.915331+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/odata-query/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}