Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +21 -0
- requirements.txt +5 -0
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import streamlit as st
|
3 |
+
import plotly.express as px
|
4 |
+
import plotly.graph_objects as go
|
5 |
+
import airportsdata
|
6 |
+
import pycountry
|
7 |
+
airports = airportsdata.load('IATA')
|
8 |
+
st.set_page_config(layout='wide')
|
9 |
+
st.title(':orange[fly]:blue[dubai]')
|
10 |
+
iata_code = st.text_input("Please enter the IATA code: ",max_chars=3).upper()
|
11 |
+
print(iata_code)
|
12 |
+
if st.button("Process: "):
|
13 |
+
print(airports[iata_code])
|
14 |
+
st.markdown("**ICAO Code:** "+airports[iata_code]['icao'])
|
15 |
+
st.markdown("**Airport Name:** "+airports[iata_code]['name'])
|
16 |
+
st.markdown("**City:** "+airports[iata_code]['city'])
|
17 |
+
st.markdown("**Subdivision:** "+airports[iata_code]['subd'])
|
18 |
+
st.markdown("**Country Code ISO-2:** "+airports[iata_code]['country'])
|
19 |
+
#getting the ISO-3 country code
|
20 |
+
var = pycountry.countries.get(alpha_2=airports[iata_code]['country'])
|
21 |
+
st.markdown("**Country Code ISO-3:** "+pycountry.countries.get(alpha_2=airports[iata_code]['country']).alpha_3)
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
pycountry
|
2 |
+
streamlit
|
3 |
+
pandas
|
4 |
+
plotly
|
5 |
+
airportsdata
|