I'm working on an application that does reporting-type things, and I often need to take a filter specified with JSON, convert that to an SQLAlchemy query, then send the results back to the browser (for example the filter start_date: 1234, end_date: 5678, widget_ids: [1, 2, 3] needs to be converted into the query … WHERE start_date >= 1234 AND end_date <= 5678 AND widget_id in (1, 2, 3)).
Is there a tool which will do this kind of conversion automatically (for example, using suffixes like Django's ORM: start_date__ge: 1234, end_date__le: 5678, widget_id__in: [1, 2, 3])?
Obviously there would be security and performance implications of such a scheme… But I'd like to know if anything like this exists before I build one myself.
Edit: I realize that I could build my own thing, but I'm specifically wondering if there are existing tools/libraries, so I don't need to re-invent the wheel.