Closed YiruJeon closed 2 years ago
@YiruJeon Thank you for your contribution, please give me some time to look into the CI errors (very busy rn).
@YiruJeon could you please run make mypy
or python3 -m mypy cryptocompare/cryptocompare.py
and fix the errors that are popping up
@lagerfeuer Oh, I was not familiar with mypy. I fixed type related errors. While doing that, I noticed that I failed to call _format_parameter
on currency
in the additional methods so I fixed them too.
And one more thing, I think get_historical_price_*
methods return Optional[List[Dict]]
not Optional[Dict]
?
Turns out, you're actually right, it is Optional[List[Dict]]
. Must've slipped through, this was one of the first projects I used mypy
with 😄
Looks good to me now, I'm not too invested in the methods you added, but since you added tests and it seems to pass, I'll merge if you're okay with it.
Well, let's do this. I guess it would be okay.
I added _MAX_LIMIT_HISTO_API = 2000
, because it is good to avoid a hard-coded constant.
allData
parameter (see https://min-api.cryptocompare.com/documentation?key=Historical&cat=dataHistoday)delay
seconds for each API calldelay
seconds for each API call