barnumbirr / coinmarketcap

A python wrapper around the https://coinmarketcap.com API.
Apache License 2.0
437 stars 110 forks source link

Store the cache data in a temporary directory rather that current working directory #30

Closed jathpala closed 6 years ago

jathpala commented 6 years ago

The current implementation stores cached data in a file called coinmarketcap_cache.sqlite in the current working directory. This is a little untidy. Given that the data is really only designed to be useful for a short period of time and it's unlikely that the user would ever want to interact with the cache file directly, would it make sense to save this file in a system temp directory instead?

I've implemented this here and would be happy to submit a pull request if it's something you would be interested in.

jathpala commented 6 years ago

Also, not sure but this may be a solution to the problem raised in #23 as it appears the problem was under that environment the current working directory was / which the user did not have write access to. Alternatively, it would be trivial to simply allow the user to supply a custom pathname when instantiating the Market object.

barnumbirr commented 6 years ago

Hey there,

I'm indeed interested, I just haven't had the time to look into it as I'm quite busy IRL at the moment. If you're up for a PR, I'll be more than happy to review it.

Cheers.

jathpala commented 6 years ago

OK cool. Have a look. #31

barnumbirr commented 6 years ago

Fixed in #31 .