mechatroner / RBQL

🦜RBQL - Rainbow Query Language: SQL-like query engine for (not only) CSV file processing. Supports SQL queries with Python and JavaScript expressions.
https://rbql.org
MIT License
281 stars 13 forks source link

Can you have some example how to use as a library #16

Closed trungbanh closed 4 years ago

trungbanh commented 4 years ago

how i can use like

import RBQL  as rbdb

rbdb.query("select * where .... ")

if can use it as function it must help for my data process

mechatroner commented 4 years ago

Hi @trungbanh ! There are 2 simple examples thow to use RBQL as a library: https://github.com/mechatroner/RBQL/blob/master/test/library_demos/table_test.py and https://github.com/mechatroner/RBQL/blob/master/test/library_demos/csv_test.py Also you can use this documentation: https://github.com/mechatroner/RBQL/blob/master/PYLIBRARY.md#api

And be prepared that RBQL generates a disposable python module for each query, so running queries with very high frequency (e.g. more than one query per second) is not recommended. Good luck and please let me know if you have other questions!

trungbanh commented 4 years ago

Hi @trungbanh ! There are 2 simple examples thow to use RBQL as a library: https://github.com/mechatroner/RBQL/blob/master/test/library_demos/table_test.py and https://github.com/mechatroner/RBQL/blob/master/test/library_demos/csv_test.py Also you can use this documentation: https://github.com/mechatroner/rbql-py/blob/master/LIBRARY.md

And be prepared that RBQL generates a disposable python module for each query, so running queries with very high frequency (e.g. more than one query per second) is not recommended. Good luck and please let me know if you have other questions!

mechatroner thank you

mechatroner commented 4 years ago

I've changed API in version 0.11:

I also updated documentation and example code