mysolenso.services.stations.ak - Station AK (geographic info)
Service for retrieving the geographic and address data of a station.
This module provides MySolensoStationAK, which wraps the
station_ak_find Solenso endpoint. One call returns the station’s
latitude, longitude, and human-readable address.
Typical usage:
client = MySolenso(username="user@example.com", password="...")
client.stationak.station_ak_refresh()
print(client.stationak.address)
print(client.stationak.latitude, client.stationak.longitude)
- class mysolenso.services.stations.ak.MySolensoStationAK(parent)[source]
Bases:
objectRetrieve geographic and address information for the active station.
This service queries the
station_ak_findendpoint using the station ID and its associated AK (access key) string. Callstation_ak_refresh()to populate the data, then read the propertieslongitude,latitude, andaddress.Use
set_station()to switch to a different station without rebuilding the entire client.- Parameters:
parent (MySolenso) – The parent client object that holds the authentication context and the active station reference.
- Raises:
MySolensoException – If no active station is set on the parent at construction time (
parent.station.station_id is None).
Example:
client = MySolenso(username="user@example.com", token="...") client.stationak.station_ak_refresh() print(client.stationak.address) # → "95 Moon Road, 99999 Galaxy, World"
- set_station(id, ak, refresh=True)[source]
Switch the active station for geographic data queries.
Updates the cached station ID and AK, then optionally re-fetches the data. The station must exist in the account’s station list.
- Parameters:
- Raises:
MySolensoException – If the requested station ID is not found in the account’s station list.
- Return type:
Example:
client.stationak.set_station(id=9999999, ak="abc123") print(client.stationak.address)
- station_ak_refresh()[source]
Force a fresh fetch of the station geographic data from the API.
Delegates to
_get_station_ak(). Call this method any time you need up-to-date coordinates or address information.Example:
client.stationak.station_ak_refresh() print(client.stationak.longitude)
- Return type:
- property all_data: dict
Raw API response for the
station_ak_findendpoint.- Returns:
Station geographic record returned verbatim by the API. Example:
{ "id": 9999999, "longitude": "39.10884652257048", "latitude": "-76.77128918829347", "address": "95 Moon Road, 99999 Galaxy, World" }
- Return type:
- Raises:
AttributeError – If
station_ak_refresh()has not been called yet.
- property id: int
Internal numeric ID of the station.
- Returns:
The station identifier as stored on the Solenso platform.
- Return type:
- property longitude: str
Longitude of the station as a decimal-degree string.
- Returns:
Decimal-degree longitude (positive = East, negative = West). Example:
"39.10884652257048".- Return type: