In preparation for working on the ESI API in more depth, I've tidied the existing API methods.
I've added basic data caches also for endpoints that are typically static:
types/items
planets
systems
regions
constellations
On the first fetch, it'll load the data into the respective cache, and in future grabs, it'll return the cached data instead. The cache is memory-only, so will be empty on bot restart.
To accommodate cases where it's somehow imperative to get fresh data for any of these, there's a keyword argument of allow_cache which is True by default. When calling the cached methods, you can pass False for this kwarg and it'll always request it from the web API again, while also refreshing the cache data with the newly retrieved data.
In preparation for working on the ESI API in more depth, I've tidied the existing API methods.
I've added basic data caches also for endpoints that are typically static:
On the first fetch, it'll load the data into the respective cache, and in future grabs, it'll return the cached data instead. The cache is memory-only, so will be empty on bot restart.
To accommodate cases where it's somehow imperative to get fresh data for any of these, there's a keyword argument of
allow_cache
which is True by default. When calling the cached methods, you can pass False for this kwarg and it'll always request it from the web API again, while also refreshing the cache data with the newly retrieved data.