azely.location module#
- class Location(name: str, longitude: str, latitude: str, altitude: str = '0 m')[source]#
Bases:
object
Location information.
- Parameters:
name (str) – Name of the location.
longitude (str) – Longitude of the location (with units).
latitude (str) – Latitude of the location (with units).
altitude (str) – Altitude of the location (with units).
- altitude: str = '0 m'#
Altitude of the location (with units).
- property earthlocation: EarthLocation#
Convert it to an astropy EarthLocation.
- latitude: str#
Latitude of the location (with units).
- longitude: str#
Longitude of the location (with units).
- name: str#
Name of the location.
- property timezone: ZoneInfo#
Convert it to an IANA ZoneInfo.
- class LocationDict[source]#
Bases:
TypedDict
Dictionary of the location information attributes.
- altitude: NotRequired[str]#
- latitude: Required[str]#
- longitude: Required[str]#
- name: Required[str]#
- get_location(query: str, /, *, google_api: str | None = None, ipinfo_api: str | None = None, sep: str = '\\s*;\\s*', timeout: float = 10.0, append: bool = True, overwrite: bool = False, source: PathLike[str] | str | None = None) Location [source]#
Parse given query to create location information.
- Parameters:
query (str) – Query string for the location information.
google_api (str | None) – Optional Google API key.
ipinfo_api (str | None) – Optional IPinfo API key.
sep (str) – Separator string for splitting the query.
timeout (float) – Timeout length in seconds.
append (bool) – Whether to append the location information to the source TOML file if it does not exist.
overwrite (bool) – Whether to overwrite the location information to the source TOML file even if it already exists.
source (PathLike[str] | str | None) – Path of a source TOML file for the location information.
- Return type:
- Returns
Location information created from the parsed query.