tomasbedrich / pycaching

A Python 3 interface for working with Geocaching.com website.
https://pycaching.readthedocs.io/
GNU Lesser General Public License v3.0
61 stars 46 forks source link

What type does cache.load_logbook() return and how do I turn it into a dict? #215

Closed DarkOutcast6 closed 1 year ago

DarkOutcast6 commented 1 year ago

What type does cache.load_logbook() return and how do I turn it into a dict?

FriedrichFroebel commented 1 year ago

Please have a look at the official API documentation for such requests: https://pycaching.readthedocs.io/en/latest/api.html#pycaching.cache.Cache.load_logbook I will leave it as a task to the reader to convert the returned class instances to dictionaries.

DarkOutcast6 commented 1 year ago

@FriedrichFroebel Just realized that this was not the problem I need help with. Instead it is, how do I turn the output of cache.load_logbook() into a list of pycaching.log.Log objects?

FriedrichFroebel commented 1 year ago

This conversion is not specific to pycaching, but a general Python issue: If you really need a list, wrap it with list(cache.load_logbook()).