tinydb search transform string to where query

22 views Asked by At

A tinydb search is done like this:

db.search(where('birthday').year == 1900)

I want to take user input as a string and pass it to search()

In other words: "where('birthday').year == 1900" becomes the above.

Is this even possible in Python?

ps. this is running purely localhost so I'm not concerned about security.

0

There are 0 answers