Ever wish you could query pandas DataFrames with SQL like this?
df = pd.DataFrame(...)
sqldf.query_df(df, """
SELECT *, sum(b)
WHERE a > 5
GROUP BY b
""")Well now you can with sqldf!
SELECTWHERE=,!=,>,>=,<,<=,IN,NOT IN
SELECT ... ASFROMGROUP BYJOINWHERE ... LIKEORDER BY
A PEG grammar is defined in sqldf/sql.gram that is passed through pegen to generate the parser in sqldf/parser.py that parses the SQL and generates objects (currently dictionaries). The generated objects are then processed to build up the relevant pandas calls to return the processed DataFrame.