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: object

Retrieve geographic and address information for the active station.

This service queries the station_ak_find endpoint using the station ID and its associated AK (access key) string. Call station_ak_refresh() to populate the data, then read the properties longitude, latitude, and address.

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:
  • id (int) – Internal numeric ID of the target station.

  • ak (str) – The station’s AK (access key / identifier) string, available as client.station.ak.

  • refresh (bool) – When True (default), immediately re-fetches the geographic data for the new station. Set to False to defer the network call.

Raises:

MySolensoException – If the requested station ID is not found in the account’s station list.

Return type:

None

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:

None

property all_data: dict

Raw API response for the station_ak_find endpoint.

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:

dict

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:

int

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:

str

property latitude: str

Latitude of the station as a decimal-degree string.

Returns:

Decimal-degree latitude (positive = North, negative = South). Example: "-76.77128918829347".

Return type:

str

property address: str

Human-readable postal address of the station.

Returns:

Full address string as entered on the Solenso platform. Example: "95 Moon Road, 99999 Galaxy, World".

Return type:

str