Skip to content

Commit

Permalink
Version 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
markyharris committed Jan 2, 2024
1 parent 26e1849 commit c9f159a
Show file tree
Hide file tree
Showing 13 changed files with 1,206 additions and 827 deletions.
482 changes: 482 additions & 0 deletions aviationweather.schema

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions data.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
kdal
-2
KFLG
-1
60
1
2
0
0
1
1
198 changes: 0 additions & 198 deletions metar.html

This file was deleted.

15 changes: 11 additions & 4 deletions metar_display.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# metar_display.py
# Metar Display - Mark Harris
# Version 2.1
# UPDATED FAA API 12-2023, https://aviationweather.gov/data/api/
#
# Altered from https://github.com/aerodynamics-py/WEATHER_STATION_PI
#
# Added a number of bold fonts
Expand Down Expand Up @@ -60,17 +63,21 @@
class Metar:
def __init__(self, airport):
self.data = requests.get(
f"https://api.weather.gov/stations/"+airport+"/observations/latest", timeout=5).json()
# f"https://api.weather.gov/stations/"+airport+"/observations/latest", timeout=5).json()
f"https://aviationweather.gov/api/data/metar?ids="+airport+"&format=json&hours=2.5").json()
self.data2 = requests.get(
f"https://api.weather.gov/stations/"+airport, timeout=5).json()
# f"https://api.weather.gov/stations/"+airport, timeout=5).json()
f"https://aviationweather.gov/api/data/metar?ids="+airport+"&format=json&hours=2.5").json()
requests.session().close()
pass

def update(self, airport):
self.data = requests.get(
f"https://api.weather.gov/stations/"+airport+"/observations/latest", timeout=5).json()
# f"https://api.weather.gov/stations/"+airport+"/observations/latest", timeout=5).json()
f"https://aviationweather.gov/api/data/metar?ids="+airport+"&format=json&hours=2.5").json()
self.data2 = requests.get(
f"https://api.weather.gov/stations/"+airport, timeout=5).json()
# f"https://api.weather.gov/stations/"+airport, timeout=5).json()
f"https://aviationweather.gov/api/data/metar?ids="+airport+"&format=json&hours=2.5").json()
requests.session().close()
return self.data, self.data2

Expand Down
Loading

0 comments on commit c9f159a

Please sign in to comment.