naturtag.client module#

class naturtag.client.ImageSession(*args, **kwargs)#

Bases: pyinaturalist.session.ClientSession

cache_size()#

Get the total cache size in bytes, and the number of cached files

Return type

str

get_image(photo, size=None)#

Get an image from the cache, if it exists; otherwise, download and cache a new one

Return type

bytes

get_pixmap(photo=None, url=None, size=None)#
Return type

QPixmap

class naturtag.client.ObservationDbController(client)#

Bases: pyinaturalist.controllers.observations_controller.ObservationController

from_ids(*observation_ids, refresh=False, **params)#

Get observations by ID; first from the database, then from the API

Return type

WrapperPaginator[Observation]

search(**params)#

Search observations, and save results to the database (for future reference by ID)

Return type

WrapperPaginator[Observation]

class naturtag.client.TaxonDbController(client)#

Bases: pyinaturalist.controllers.taxon_controller.TaxonController

from_ids(*taxon_ids, accept_partial=False, refresh=False, **params)#

Get taxa by ID; first from the database, then from the API

Return type

WrapperPaginator[Taxon]

search(**params)#

Search taxa, and save results to the database (for future reference by ID)

Return type

WrapperPaginator[Taxon]

naturtag.client.get_url_hash(url)#

Generate a hash to use as a cache key from an image URL, appended with the file extension

Parameters

source – File path or URI for image source

Return type

str

class naturtag.client.iNatDbClient(**kwargs)#

Bases: pyinaturalist.client.iNatClient

API client class that uses a local SQLite database to cache observations and taxa (when searched by ID)