SHAMIL SHAHBAZ AWAN commited on
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import requests
|
| 4 |
+
|
| 5 |
+
# Title and Description
|
| 6 |
+
st.title("Rural Connectivity Advisor")
|
| 7 |
+
st.markdown("""
|
| 8 |
+
Welcome to the **Rural Connectivity Advisor**! This app helps rural communities find affordable internet solutions,
|
| 9 |
+
boost connectivity, and access offline tools for education, healthcare, and business needs.
|
| 10 |
+
""")
|
| 11 |
+
|
| 12 |
+
# Sidebar Input
|
| 13 |
+
st.sidebar.header("Input Your Details")
|
| 14 |
+
location = st.sidebar.text_input("Enter Your Location (e.g., City, District)")
|
| 15 |
+
needs = st.sidebar.selectbox("What do you need?", ["Internet Provider", "Signal Boosting Tips", "Offline Tools"])
|
| 16 |
+
|
| 17 |
+
# Placeholder for Internet Providers
|
| 18 |
+
@st.cache_data
|
| 19 |
+
def fetch_providers(location):
|
| 20 |
+
"""Fetch a list of internet providers based on location (simulated data)."""
|
| 21 |
+
# Simulated data (replace with a real API or database in the future)
|
| 22 |
+
providers = {
|
| 23 |
+
"satellite": [
|
| 24 |
+
{"name": "Starlink", "type": "Satellite", "cost": "$110/month", "coverage": "Global"},
|
| 25 |
+
{"name": "HughesNet", "type": "Satellite", "cost": "$60/month", "coverage": "North America"},
|
| 26 |
+
],
|
| 27 |
+
"local": [
|
| 28 |
+
{"name": "LocalNet Rural", "type": "Local ISP", "cost": "$40/month", "coverage": "Regional"},
|
| 29 |
+
],
|
| 30 |
+
}
|
| 31 |
+
return providers
|
| 32 |
+
|
| 33 |
+
# Display Internet Providers
|
| 34 |
+
if needs == "Internet Provider":
|
| 35 |
+
st.subheader("Suggested Internet Providers")
|
| 36 |
+
if location:
|
| 37 |
+
providers = fetch_providers(location)
|
| 38 |
+
st.markdown("### Satellite Providers")
|
| 39 |
+
for provider in providers["satellite"]:
|
| 40 |
+
st.write(f"- **{provider['name']}** ({provider['type']}): {provider['cost']} | Coverage: {provider['coverage']}")
|
| 41 |
+
st.markdown("### Local Providers")
|
| 42 |
+
for provider in providers["local"]:
|
| 43 |
+
st.write(f"- **{provider['name']}** ({provider['type']}): {provider['cost']} | Coverage: {provider['coverage']}")
|
| 44 |
+
else:
|
| 45 |
+
st.warning("Please enter your location to see provider recommendations.")
|
| 46 |
+
|
| 47 |
+
# Signal Boosting Tips
|
| 48 |
+
elif needs == "Signal Boosting Tips":
|
| 49 |
+
st.subheader("Signal Boosting Tips")
|
| 50 |
+
st.markdown("""
|
| 51 |
+
- **Place your router** in a central location, away from walls and obstructions.
|
| 52 |
+
- Use **Wi-Fi range extenders** or mesh networks to improve coverage.
|
| 53 |
+
- Install external antennas for better signal reception.
|
| 54 |
+
- Minimize interference by keeping the router away from electronic devices like microwaves.
|
| 55 |
+
""")
|
| 56 |
+
|
| 57 |
+
# Offline Tools Recommendations
|
| 58 |
+
elif needs == "Offline Tools":
|
| 59 |
+
st.subheader("Recommended Offline Tools")
|
| 60 |
+
st.markdown("""
|
| 61 |
+
- **Education**: Download content from [Khan Academy](https://www.khanacademy.org/) or use offline features of apps like Coursera.
|
| 62 |
+
- **Healthcare**: Use offline-first telemedicine tools like Healthline's symptom checker.
|
| 63 |
+
- **Agriculture**: Use apps like FarmLogs for crop monitoring (syncs data when online).
|
| 64 |
+
- **Business**: Set up Point-of-Sale (POS) systems like Square, which work offline and sync when connected.
|
| 65 |
+
""")
|
| 66 |
+
|
| 67 |
+
# Footer
|
| 68 |
+
st.markdown("---")
|
| 69 |
+
st.caption("Developed with ❤️ using open-source tools for rural communities.")
|
| 70 |
+
|