SQL to Databox with Databox Python SDK
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
sql
.env
.gitignore
.travis.yml
LICENSE
README.md
db.py
mysql_streamer.py
requirements.txt
stocks_downloader.py

README.md

SQL to Databox

Answer to the question: How to move data from SQL server to Databox with help from Databox Python SDK?

License

MySQL → Databox streaming Example

Create new empty databox_example database with stocks table.

mysql -u root -vv < sql/mysql_recreate_database.sql

Start mysql_streamer.py script that will "observe" stocks table for new records and stream them into Databox.

./mysql_streamer.py databox_example -u root -t <databox push_token>

Open new command-prompt and insert few historical stock quotes with stocks_downloader.py.

./stocks_downloader.py YHOO -g m -x sql | mysql -u root -vv databox_example;

Simple output from mysql_streamer.py

...
Nothing to do. Sleeping,...
Streaming from 454
Inserted new records from 454,...
Nothing to do. Sleeping,...
Streaming from 460
Inserted new records from 460,...
Nothing to do. Sleeping,...
Nothing to do. Sleeping,...
Nothing to do. Sleeping,...
...

Development

mkvirtualenv databox-python-sql
pip install --upgrade -v -r requirements.txt

Author