lagerfeuer / cryptocompare

Python3 Wrapper for the CryptoCompare API
MIT License
181 stars 73 forks source link

Updated price history APIs(day/hour/minute) to v2 and additional functions #55

Closed YiruJeon closed 2 years ago

YiruJeon commented 2 years ago
lagerfeuer commented 2 years ago

@YiruJeon Thank you for your contribution, please give me some time to look into the CI errors (very busy rn).

lagerfeuer commented 2 years ago

@YiruJeon could you please run make mypy or python3 -m mypy cryptocompare/cryptocompare.py and fix the errors that are popping up

YiruJeon commented 2 years ago

@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]?

lagerfeuer commented 2 years ago

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.

YiruJeon commented 2 years ago

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.