pyowm.geocodingapi10 package¶
Submodules¶
pyowm.geocodingapi10.geocoding_manager module¶
- class pyowm.geocodingapi10.geocoding_manager.GeocodingManager(API_key, config)[source]¶
Bases:
objectA manager objects that provides a full interface to OWM Geocoding API.
- Parameters:
API_key (str) – the OWM API key
config (dict) – the configuration dictionary
- Returns:
an GeocodingManager instance
- Raises:
AssertionError when no API Key is provided
- geocode(toponym, country=None, state_code=None, limit=None)[source]¶
Invokes the direct geocoding API endpoint
- Parameters:
toponym (str) – the name of the location
country (str or None) – the 2-chars ISO symbol of the country
state_code (str or None) – the 2-chars ISO symbol of state (only useful in case the country is US)
limit (int or None) – the max number of results to be returned in case of multiple matchings (no limits by default)
- Returns:
a list of Location instances
- Raises:
AssertionError, ValueError, APIRequestError