pandas-datareader icon indicating copy to clipboard operation
pandas-datareader copied to clipboard

Adding support for Binance Crypto Currency Exchange

Open rohitjain00 opened this issue 6 years ago • 13 comments

  • Binance Exchange is a exchange for crypto currencies.
  • It provides a API for users to retrieve data
  • We can add support for this which would increase the usability of this module

rohitjain00 avatar Jun 07 '19 13:06 rohitjain00

@rohitjain00 that would be nice for sure!

douglaspetrin avatar Jun 15 '19 16:06 douglaspetrin

base.py is the base class above which all the APIs for different source of data needed to be implemented?

rohitjain00 avatar Jun 20 '19 16:06 rohitjain00

@rohitjain00 https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md

maybe you could use https://github.com/pydata/pandas-datareader/blob/master/pandas_datareader/eurostat.py as a starting point

gliptak avatar Sep 17 '19 23:09 gliptak

Thanks for the help. I have already started working on it. I am facing an issue with the implementation I want user to provide me with Interval of the data required which is mandatory for the API. As per the DataReader method I can only take input with provided parameters. Is there any way to take custom input from the user and to expose a ENUM class to the user to pass intervals in them.

Also is there any slack/gitter channel for the help.

rohitjain00 avatar Sep 18 '19 21:09 rohitjain00

I'm not sure whet intervals you are referring to above. Maybe

Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

Providers can introduce additional parameters. As an example review https://github.com/pydata/pandas-datareader/blob/master/pandas_datareader/av/time_series.py#L46

gliptak avatar Sep 18 '19 23:09 gliptak

@gliptak can you review my code for this and provide me with feedback on how to improve the implementation. I still need to write docs and tests for this.

Here are proposed changes

rohitjain00 avatar Sep 19 '19 16:09 rohitjain00

@rohitjain00 looks like a good start.

are these the right values for Binance API https://github.com/pydata/pandas-datareader/compare/master...rohitjain00:binance#diff-858c99a95d8c111146c613999fcc7443R13 ?

please add test(s) and submit as a PR (to review Travis results and so committers can comment)

gliptak avatar Sep 19 '19 21:09 gliptak

I have written tests for checking the dimensions and columns of the response. I am relatively new to writing tests can you suggest me what more checks to add in this.

Here are the changes Here is the test file

rohitjain00 avatar Sep 22 '19 10:09 rohitjain00

@rohitjain00 please start a PR https://github.com/pydata/pandas-datareader should show your branch referenced above

That is a good initial test. Maybe you could also add a test to check open/high/low/close for a particular date

gliptak avatar Sep 22 '19 20:09 gliptak

For now I will start a PR for the above branch and keep updating new test cases and improvements.

rohitjain00 avatar Sep 23 '19 01:09 rohitjain00

As much as I would love to see this, the CCXT package supports practically every crypto exchange on the market. Would it make more sense to integrate with it directly or am I off my base here?

dahifi avatar Oct 06 '19 12:10 dahifi

any updates on this ? Is it available ?

malakeel avatar Jul 07 '21 21:07 malakeel

It was available when I created a CR but @dahifi recommended something better and I did not had bandwidth to implement it. So if anyone else is willing to take on this task it would be awesome.

rohitjain00 avatar Jul 09 '21 21:07 rohitjain00