LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
688 stars 164 forks source link

Writing to SQLite #33

Closed n01ukn0w closed 4 years ago

n01ukn0w commented 5 years ago

I am trying to write 1min candles to SQLite but can't seem to get it to write. I am a novice at best coder so forgive me for being ignorant.

I can get the stream to write to a file but can't seem to get it to write to SQLite.

I am not sure how to use the process stream file which would probably make this easier?

I have attached current code. unicorn-4 - Copy.txt

oliver-zehentleitner commented 5 years ago

Hi!

I recommend not using the process stream file, just work with the stream_buffer!

If you need help to a specific problem, it would help to post the error message you get. Even if I try your script, i can not be sure to run into the same problem you did. So please post your error message and explain your environment.

When you post your code, please use "insert code" and remove unused code. This makes it much more readable.

SQLite is not a good choice to work with a huge amount of data. i would recommend mysql or (what I use) postgresql.

If you tend to use mysql, you can use this project as a template: https://github.com/DaWe35/Binance-websocket-api-to-mysql

Best regards!

oliver-zehentleitner commented 4 years ago

Please feel free to re-open if needed.