Spaces:
Sleeping
Sleeping
Download src/streamlit_app.py from MSivasandeep/BharathMap: direct link, hf CLI and curl.
- Browser
- Download file 11.9 kB
-
https://huggingface.co/spaces/MSivasandeep/BharathMap/resolve/main/src/streamlit_app.py
- Command line
-
hf download hf://spaces/MSivasandeep/BharathMap/src/streamlit_app.py
-
curl -L -o streamlit_app.py https://huggingface.co/spaces/MSivasandeep/BharathMap/resolve/main/src/streamlit_app.py
11.9 kB
| import streamlit as st | |
| # Page configuration | |
| st.set_page_config(page_title=" BharatMaps", layout="centered") | |
| # App Header | |
| st.markdown(""" | |
| <div style="background: linear-gradient(to right, #1e3a8a, #2563eb); padding: 1rem; text-align: center; color: black; border-radius: 10px;"> | |
| <h1 style="margin: 0;">๐ฎ๐ณ BharatMaps: Learn by Clicking States</h1> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Language selector | |
| language = st.selectbox("๐ Select Language", ["English"]) | |
| # ------------------ ALL 28 STATES + 8 UTs ------------------ | |
| # NOTE: `None` is used instead of `null` or `Null` | |
| state_data = { | |
| "Andhra Pradesh": { | |
| "capital": "Amaravati", | |
| "population": "49.5M", | |
| "chief_minister": "N. Chandrababu Naidu", | |
| "festivals": ["Ugadi", "Pongal"], | |
| "places": ["Tirupati", "Vijayawada", "Visakhapatnam"], | |
| "foods": ["Pesarattu", "Pulihora"] | |
| }, | |
| "Arunachal Pradesh": { | |
| "capital": "Itanagar", | |
| "population": "1.6M", | |
| "chief_minister": "Pema Khandu", | |
| "festivals": ["Losar", "Solung"], | |
| "places": ["Tawang", "Ziro", "Bomdila"], | |
| "foods": ["Thukpa", "Apong"] | |
| }, | |
| "Assam": { | |
| "capital": "Dispur", | |
| "population": "36.5M", | |
| "chief_minister": "Himanta Biswa Sarma", | |
| "festivals": ["Bihu", "Durga Puja"], | |
| "places": ["Guwahati", "Kaziranga", "Majuli"], | |
| "foods": ["Khar", "Masor Tenga"] | |
| }, | |
| "Bihar": { | |
| "capital": "Patna", | |
| "population": "124.8M", | |
| "chief_minister": "Nitish Kumar", | |
| "festivals": ["Chhath", "Diwali"], | |
| "places": ["Bodh Gaya", "Nalanda", "Rajgir"], | |
| "foods": ["Litti Chokha", "Sattu Paratha"] | |
| }, | |
| "Chhattisgarh": { | |
| "capital": "Raipur", | |
| "population": "29.4M", | |
| "chief_minister": "Vishnu Deo Sai", | |
| "festivals": ["Bastar Dussehra", "Hareli"], | |
| "places": ["Jagdalpur", "Raipur", "Bilaspur"], | |
| "foods": ["Chana Samosa", "Faraa"] | |
| }, | |
| "Goa": { | |
| "capital": "Panaji", | |
| "population": "1.6M", | |
| "chief_minister": "Pramod Sawant", | |
| "festivals": ["Carnival", "Shigmo"], | |
| "places": ["Calangute", "Panaji", "Margao"], | |
| "foods": ["Prawn Balchรฃo", "Fish Curry Rice"] | |
| }, | |
| "Gujarat": { | |
| "capital": "Gandhinagar", | |
| "population": "70.3M", | |
| "chief_minister": "Bhupendrabhai Patel", | |
| "festivals": ["Navratri", "Uttarayan"], | |
| "places": ["Ahmedabad", "Gir", "Dwarka"], | |
| "foods": ["Dhokla", "Thepla"] | |
| }, | |
| "Haryana": { | |
| "capital": "Chandigarh", | |
| "population": "28.2M", | |
| "chief_minister": "Nayab Singh Saini", | |
| "festivals": ["Teej", "Holi"], | |
| "places": ["Gurgaon", "Kurukshetra", "Panipat"], | |
| "foods": ["Bajra Khichdi", "Churma"] | |
| }, | |
| "Himachal Pradesh": { | |
| "capital": "Shimla", | |
| "population": "7.4M", | |
| "chief_minister": "Sukhvinder Singh Sukhu", | |
| "festivals": ["Losar", "Kullu Dussehra"], | |
| "places": ["Shimla", "Manali", "Dharamshala"], | |
| "foods": ["Sidu", "Chana Madra"] | |
| }, | |
| "Jharkhand": { | |
| "capital": "Ranchi", | |
| "population": "38.2M", | |
| "chief_minister": "Hemant Soren", | |
| "festivals": ["Sarhul", "Karma"], | |
| "places": ["Ranchi", "Jamshedpur", "Deoghar"], | |
| "foods": ["Thekua", "Dhuska"] | |
| }, | |
| "Karnataka": { | |
| "capital": "Bengaluru", | |
| "population": "68.4M", | |
| "chief_minister": "Siddaramaiah", | |
| "festivals": ["Ugadi", "Dasara"], | |
| "places": ["Mysuru", "Hampi", "Coorg"], | |
| "foods": ["Bisi Bele Bath", "Ragi Mudde"] | |
| }, | |
| "Kerala": { | |
| "capital": "Thiruvananthapuram", | |
| "population": "35.3M", | |
| "chief_minister": "Pinarayi Vijayan", | |
| "festivals": ["Onam", "Vishu"], | |
| "places": ["Alleppey", "Munnar", "Kochi"], | |
| "foods": ["Appam", "Sadya"] | |
| }, | |
| "Madhya Pradesh": { | |
| "capital": "Bhopal", | |
| "population": "85.3M", | |
| "chief_minister": "Mohan Yadav", | |
| "festivals": ["Diwali", "Navratri"], | |
| "places": ["Khajuraho", "Ujjain", "Bhopal"], | |
| "foods": ["Poha", "Bhutte ka Kees"] | |
| }, | |
| "Maharashtra": { | |
| "capital": "Mumbai", | |
| "population": "123.1M", | |
| "chief_minister": "Eknath Shinde", | |
| "festivals": ["Ganesh Chaturthi", "Gudi Padwa"], | |
| "places": ["Mumbai", "Pune", "Aurangabad"], | |
| "foods": ["Vada Pav", "Puran Poli"] | |
| }, | |
| "Manipur": { | |
| "capital": "Imphal", | |
| "population": "3.3M", | |
| "chief_minister": "N. Biren Singh", | |
| "festivals": ["Yaoshang", "Ningol Chakouba"], | |
| "places": ["Imphal", "Loktak Lake", "Moirang"], | |
| "foods": ["Eromba", "Chamthong"] | |
| }, | |
| "Meghalaya": { | |
| "capital": "Shillong", | |
| "population": "3.8M", | |
| "chief_minister": "Conrad Sangma", | |
| "festivals": ["Wangala", "Shad Suk Mynsiem"], | |
| "places": ["Shillong", "Cherrapunji", "Mawsynram"], | |
| "foods": ["Jadoh", "Dohneiiong"] | |
| }, | |
| "Mizoram": { | |
| "capital": "Aizawl", | |
| "population": "1.2M", | |
| "chief_minister": "Lalduhoma", | |
| "festivals": ["Chapchar Kut", "Mim Kut"], | |
| "places": ["Aizawl", "Lunglei", "Champhai"], | |
| "foods": ["Bai", "Misa Mach Poora"] | |
| }, | |
| "Nagaland": { | |
| "capital": "Kohima", | |
| "population": "2.3M", | |
| "chief_minister": "Neiphiu Rio", | |
| "festivals": ["Hornbill", "Moatsu"], | |
| "places": ["Kohima", "Dimapur", "Mokokchung"], | |
| "foods": ["Smoked Pork", "Axone"] | |
| }, | |
| "Odisha": { | |
| "capital": "Bhubaneswar", | |
| "population": "46.8M", | |
| "chief_minister": "Naveen Patnaik", | |
| "festivals": ["Rath Yatra", "Durga Puja"], | |
| "places": ["Puri", "Konark", "Bhubaneswar"], | |
| "foods": ["Dalma", "Chhena Poda"] | |
| }, | |
| "Punjab": { | |
| "capital": "Chandigarh", | |
| "population": "30.1M", | |
| "chief_minister": "Bhagwant Mann", | |
| "festivals": ["Baisakhi", "Lohri"], | |
| "places": ["Amritsar", "Ludhiana", "Patiala"], | |
| "foods": ["Makki di Roti", "Sarson da Saag"] | |
| }, | |
| "Rajasthan": { | |
| "capital": "Jaipur", | |
| "population": "81M", | |
| "chief_minister": "Bhajan Lal Sharma", | |
| "festivals": ["Teej", "Gangaur"], | |
| "places": ["Jaipur", "Udaipur", "Jodhpur"], | |
| "foods": ["Dal Baati Churma", "Gatte ki Sabzi"] | |
| }, | |
| "Sikkim": { | |
| "capital": "Gangtok", | |
| "population": "0.7M", | |
| "chief_minister": "Prem Singh Tamang", | |
| "festivals": ["Losar", "Saga Dawa"], | |
| "places": ["Gangtok", "Tsomgo Lake", "Pelling"], | |
| "foods": ["Phagshapa", "Gundruk Soup"] | |
| }, | |
| "Tamil Nadu": { | |
| "capital": "Chennai", | |
| "population": "72.1M", | |
| "chief_minister": "M. K. Stalin", | |
| "festivals": ["Pongal", "Thaipusam"], | |
| "places": ["Chennai", "Madurai", "Kanyakumari"], | |
| "foods": ["Idli", "Dosa", "Sambar"] | |
| }, | |
| "Telangana": { | |
| "capital": "Hyderabad", | |
| "population": "35.2M", | |
| "chief_minister": "Revanth Reddy", | |
| "festivals": ["Bonalu", "Bathukamma"], | |
| "places": ["Hyderabad", "Warangal", "Nizamabad"], | |
| "foods": ["Hyderabadi Biryani", "Sakinalu"] | |
| }, | |
| "Tripura": { | |
| "capital": "Agartala", | |
| "population": "4.2M", | |
| "chief_minister": "Manik Saha", | |
| "festivals": ["Garia Puja", "Durga Puja"], | |
| "places": ["Agartala", "Unakoti", "Udaipur"], | |
| "foods": ["Mui Borok", "Chuak"] | |
| }, | |
| "Uttar Pradesh": { | |
| "capital": "Lucknow", | |
| "population": "237.8M", | |
| "chief_minister": "Yogi Adityanath", | |
| "festivals": ["Diwali", "Holi"], | |
| "places": ["Varanasi", "Agra", "Lucknow"], | |
| "foods": ["Tunday Kebab", "Peda"] | |
| }, | |
| "Uttarakhand": { | |
| "capital": "Dehradun", | |
| "population": "11.1M", | |
| "chief_minister": "Pushkar Singh Dhami", | |
| "festivals": ["Kumbh Mela", "Harela"], | |
| "places": ["Nainital", "Haridwar", "Rishikesh"], | |
| "foods": ["Aloo Ke Gutke", "Kafuli"] | |
| }, | |
| "West Bengal": { | |
| "capital": "Kolkata", | |
| "population": "99.6M", | |
| "chief_minister": "Mamata Banerjee", | |
| "festivals": ["Durga Puja", "Poila Boishakh"], | |
| "places": ["Kolkata", "Darjeeling", "Sundarbans"], | |
| "foods": ["Macher Jhol", "Rosogolla"] | |
| }, | |
| "Delhi": { | |
| "capital": "New Delhi", | |
| "population": "19.6M", | |
| "chief_minister": "Arvind Kejriwal", | |
| "festivals": ["Diwali", "Holi"], | |
| "places": ["Red Fort", "Qutub Minar", "India Gate"], | |
| "foods": ["Chole Bhature", "Paratha"] | |
| }, | |
| "Ladakh": { | |
| "capital": "Leh", | |
| "population": "0.3M", | |
| "chief_minister": None, | |
| "festivals": ["Losar", "Hemis Festival"], | |
| "places": ["Leh", "Pangong Lake", "Nubra Valley"], | |
| "foods": ["Skyu", "Thukpa"] | |
| }, | |
| "Puducherry": { | |
| "capital": "Puducherry", | |
| "population": "1.6M", | |
| "chief_minister": "N. Rangasamy", | |
| "festivals": ["Pongal", "Bastille Day"], | |
| "places": ["Auroville", "Paradise Beach", "Rock Beach"], | |
| "foods": ["French Crepes", "Seafood Curry"] | |
| }, | |
| "Andaman and Nicobar Islands": { | |
| "capital": "Port Blair", | |
| "population": "0.4M", | |
| "chief_minister": None, | |
| "festivals": ["Island Tourism Festival", "Durga Puja"], | |
| "places": ["Havelock Island", "Neil Island", "Cellular Jail"], | |
| "foods": ["Fish Curry", "Coconut Prawn"] | |
| }, | |
| "Lakshadweep": { | |
| "capital": "Kavaratti", | |
| "population": "0.07M", | |
| "chief_minister": None, | |
| "festivals": ["Eid", "Milad-un-Nabi"], | |
| "places": ["Minicoy Island", "Bangaram Island", "Agatti Island"], | |
| "foods": ["Tuna Curry", "Coconut Rice"] | |
| }, | |
| "Chandigarh": { | |
| "capital": "Chandigarh", | |
| "population": "1.1M", | |
| "chief_minister": None, | |
| "festivals": ["Baisakhi", "Diwali"], | |
| "places": ["Rock Garden", "Sukhna Lake"], | |
| "foods": ["Rajma Chawal", "Paneer Tikka"] | |
| }, | |
| "Jammu and Kashmir": { | |
| "capital": "Srinagar", | |
| "population": "13.6M", | |
| "chief_minister": None, | |
| "festivals": ["Eid", "Baisakhi"], | |
| "places": ["Gulmarg", "Pahalgam", "Dal Lake"], | |
| "foods": ["Rogan Josh", "Yakhni"] | |
| }, | |
| "Dadra and Nagar Haveli and Daman and Diu": { | |
| "capital": "Daman", | |
| "population": "0.6M", | |
| "chief_minister": None, | |
| "festivals": ["Nariyal Poornima", "Garba"], | |
| "places": ["Diu Fort", "Jampore Beach"], | |
| "foods": ["Seafood Fry", "Dhokla"] | |
| } | |
| } | |
| # Select dropdown | |
| selected_state = st.selectbox("๐บ๏ธ Select a State or Union Territory", sorted(state_data.keys())) | |
| # Show info card | |
| if selected_state: | |
| data = state_data[selected_state] | |
| st.markdown(f""" | |
| <div style="background: black; border-radius: 12px; padding: 1.5rem; margin-top: 1rem; | |
| box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); transition: all 0.3s;"> | |
| <h2 style="color:#1d4ed8;">๐ {selected_state}</h2> | |
| <p><strong>๐๏ธ Capital:</strong> {data['capital']}</p> | |
| <p><strong>๐ฅ Population:</strong> {data['population']}</p> | |
| <p><strong>๐งโโ๏ธ Chief Minister:</strong> {data['chief_minister'] if data['chief_minister'] else "Administered by LG"}</p> | |
| <p><strong>๐ Festivals:</strong> {", ".join(data['festivals'])}</p> | |
| <p><strong>๐๏ธ Famous Places:</strong> {", ".join(data['places'])}</p> | |
| <p><strong>๐ Local Foods:</strong> {", ".join(data['foods'])}</p> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Footer | |
| st.markdown(""" | |
| <hr style="margin-top: 3rem;"> | |
| <p style="text-align: center; color: gray;">Made By Wiki_Arena</p> | |
| """, unsafe_allow_html=True) | |