On 2013-06-26 16:17, Foo Stack wrote: > Given string input such as: > foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello' > > I am going to implement: > > - boolean understanding (which operator takes precendence) > - spliting off of attributes into my function which computes their > table in the SQL database > - piece everything together into an SQL query > > However, it came to me that this is probably a very generic thing; > and there might be a library for it.
It sounds like you might want to use pyparsing and start with something akin to this[1] -tkc [1] http://pyparsing.wikispaces.com/file/view/simpleSQL.py -- http://mail.python.org/mailman/listinfo/python-list