odata-query
An OData query parser and transpiler.
What it is and what it does
odata-query is a parser and transpiler for OData v4 filter strings—the standardized query format used in REST APIs. It reads an OData filter expression and converts it into native query objects for your ORM or database layer. The package supports Django QuerySets, SQLAlchemy ORM queries, and SQLAlchemy Core, making it useful when you need to expose OData-compliant filtering to API clients without writing custom query translation logic.
The library depends on python-dateutil for date handling and sly for parsing. It's marked Production/Stable and supports Python 3.7 through 3.12, but has been dormant for over two years—no active maintenance or updates. Installation is straightforward with optional extras for Django and SQLAlchemy integration.
Use it for:
- Build a REST API that accepts OData filter strings and translates them to Django ORM queries without manual parsing.
- Convert OData queries to SQLAlchemy expressions in a data service layer.
- Parse OData filters to raw SQL for direct database queries in non-ORM scenarios.
- Expose standardized query syntax to API clients while keeping backend query logic decoupled.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses OData v4 filter strings and transpiles them to Django QuerySets, SQLAlchemy queries, or raw SQL for database filtering.
Yes, if you need OData v4 filter parsing for Django or SQLAlchemy and can tolerate dormant maintenance. The package is stable and has no known vulnerabilities, with low install friction. However, verify compatibility with your specific ORM versions before relying on it in production, since the last release was 777 days ago and no updates are forthcoming.
Install
odata-query on PyPI
pip
pip install odata-queryuv
uv add odata-querypoetry
poetry add odata-queryInstalling odata-query
Before you install
Low friction: pure Python wheel with only two runtime dependencies (python-dateutil and sly). Maintenance is dormant—last release was 777 days ago—so expect no active bug fixes or feature updates, though the package is marked Production/Stable.
License in practice
MIT license (permissive) means you can use this freely in commercial and open-source projects with minimal restrictions, provided you include the license notice.
Quickstart
pip install odata-query
from odata_query.django import apply_odata_query
query = apply_odata_query(MyModel.objects, "name eq 'test'")
results = query.all()
Requires Python 3.7–3.12; optional extras (django, sqlalchemy) must be installed separately if you want ORM integration.
Verify before relying
- Whether dormant status (777 days since last release) affects compatibility with recent Django/SQLAlchemy versions.
- Whether the modular/extensible architecture mentioned in docs supports custom ORM backends beyond Django and SQLAlchemy.
- Real-world performance and feature completeness for complex OData filter expressions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — python-dateutil, sly |
| Maintenance | dormant — 777 days since the last release |
| First released | |
| Downloads | 161,453/month — #10,632 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: odata_query-0.10.0-py3-none-any.whl
Keywords: OData, Query, Parser
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
pyodatapyodata is a Python client library that…
permissive · top 15,000 on PyPI
sqlalchemy-mixinsProvides Active Record-style mixins for…
permissive · top 15,000 on PyPI
scim2-filter-parserParses SCIM 2.0 filter query strings into…
permissive · top 5,000 on PyPI
fastapi-filterAdds declarative filtering, sorting, and…
permissive · top 15,000 on PyPI
djongoDjongo translates Django ORM queries into…
permissive · top 15,000 on PyPI
sqlalchemy-filtersAdds filtering, sorting, and pagination…
permissive · top 15,000 on PyPI
sqlalchemy-solrProvides a SQLAlchemy dialect that allows you…
permissive · top 15,000 on PyPI
django-query-builderBuilds and executes complex SQL queries…
permissive · top 15,000 on PyPI
teradatasqlalchemyProvides a SQLAlchemy dialect that enables…
unclear · top 5,000 on PyPI
django-cteAdds Common Table Expressions (CTE) support to…
permissive · top 5,000 on PyPI