stas-prokopiev / binance_historical_data

python PYPI package to dump all needed crypto historical data from binance just by 2 lines of code
MIT License
71 stars 25 forks source link

since last update (0.1.8), BinanceDataDumper might not been properly working #2

Closed gustavomrg closed 1 year ago

gustavomrg commented 2 years ago

Since last update,

every time I try to import BinanceDataDumper,

from binance_historical_data import BinanceDataDumper
import datetime

data_dumper = BinanceDataDumper(
    path_dir_where_to_dump="./test/",
    data_type="klines",  # aggTrades, klines, trades
    data_frequency="5m",  # argument for data_type="klines"
)

I keep getting the following error message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-124f350d6565> in <module>
----> 1 from binance_historical_data import BinanceDataDumper
      2 import datetime
      3 
      4 data_dumper = BinanceDataDumper(
      5     path_dir_where_to_dump="./teste/",

/opt/conda/lib/python3.8/site-packages/binance_historical_data/__init__.py in <module>
      6 # Local imports
      7 from . import logger
----> 8 from .data_dumper import BinanceDataDumper
      9 
     10 # Global constants

/opt/conda/lib/python3.8/site-packages/binance_historical_data/data_dumper.py in <module>
     23 
     24 
---> 25 class BinanceDataDumper():
     26 
     27     _ASSET_CLASSES = ("spot")  # , "futures"

/opt/conda/lib/python3.8/site-packages/binance_historical_data/data_dumper.py in BinanceDataDumper()
    229             is_to_update_existing=False,
    230             int_max_tickers_to_get=None,
--> 231             tickers_to_exclude : Optional[list[str]] = None,
    232     ):
    233         """Main method to dump new of update existing historical data

TypeError: 'type' object is not subscriptable
stas-prokopiev commented 2 years ago

Hi, I'm sorry for your bad experience with my python package. I will try to fix this error today. Until then you can try to use the previous versions of the package: pip install binance_historical_data==0.1.7 I'll write here once the problem is identified and fixed.

Best regards, Stas.

gustavomrg commented 2 years ago

I'm not having a bad experience at all, actually, it has been very helpful in the past 2 moths! Nice job!

stas-prokopiev commented 2 years ago

Hi, I released a fix. Seems that the problem was with type hints which change a lot with python versions. Also, I added the simplest tox tests to prevent such problems in the future.

To install the latest version please use: pip install binance_historical_data==0.1.9 Could you please confirm that the issue was tackled?