casageo.tools module
This module provides vocabulary types and shared implementation code used throughout the casaGeoTools library.
- class casageo.tools.CasaGeoClient(key, *, preferred_language=None, preferred_political_view=None, preferred_unit_system=None)
Bases:
objectThe casaGeo API client.
The
preferred_*attributes are used as default values when making API requests and override the module defaults if notNone.- preferred_language
The preferred language for responses. This must be a valid IETF BCP47 language tag, such as
"en-US", or a comma-separated list of such tags in order of preference.
- preferred_political_view
The preferred political view for responses. This must be a valid ISO 3166-1 alpha-3 country code.
- preferred_unit_system
The preferred unit system for responses, either
"metric"or"imperial".
- Parameters:
key (str) – Your casaGeo API key.
preferred_language (str | None) – The preferred language for responses.
preferred_political_view (str | None) – The preferred political view for responses.
preferred_unit_system (str | None) – The preferred unit system for responses.
- exception casageo.tools.CasaGeoError
Bases:
Exception
- exception casageo.tools.APIReturnTypeError
Bases:
CasaGeoError,TypeError
- exception casageo.tools.APIValueError
Bases:
CasaGeoError,ValueError
- exception casageo.tools.InsufficientCreditsError(message=None, *, required=None, available=None)
Bases:
CasaGeoError- Parameters:
message (str | None)
required (int | None)
available (int | None)
- exception casageo.tools.SubqueryError(message, *, code=None, index=None, details=None)
Bases:
CasaGeoError- Parameters:
message (str)
code (str | None)
index (int | None)
details (str | None)