Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,13 +11,46 @@ KYS_SAMPLE = "https://kys.udiseplus.gov.in/webapp/api/search-schools?searchType=
|
|
| 11 |
|
| 12 |
# List of valid state codes for UDISE (first 2 digits of UDISE code)
|
| 13 |
VALID_UDISE_STATE_CODES = [
|
| 14 |
-
'
|
| 15 |
-
'
|
| 16 |
-
'
|
| 17 |
-
'
|
| 18 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
]
|
| 20 |
|
|
|
|
| 21 |
def is_valid_udise(code):
|
| 22 |
"""Check if a string is a valid UDISE code."""
|
| 23 |
if not (code and code.isdigit() and len(code) == 11):
|
|
|
|
| 11 |
|
| 12 |
# List of valid state codes for UDISE (first 2 digits of UDISE code)
|
| 13 |
VALID_UDISE_STATE_CODES = [
|
| 14 |
+
'01', # Jammu & Kashmir
|
| 15 |
+
'02', # Himachal Pradesh
|
| 16 |
+
'03', # Punjab
|
| 17 |
+
'04', # Chandigarh
|
| 18 |
+
'05', # Uttarakhand
|
| 19 |
+
'06', # Haryana
|
| 20 |
+
'07', # Delhi
|
| 21 |
+
'08', # Rajasthan
|
| 22 |
+
'09', # Uttar Pradesh
|
| 23 |
+
'10', # Bihar
|
| 24 |
+
'11', # Sikkim
|
| 25 |
+
'12', # Arunachal Pradesh
|
| 26 |
+
'13', # Nagaland
|
| 27 |
+
'14', # Manipur
|
| 28 |
+
'15', # Mizoram
|
| 29 |
+
'16', # Tripura
|
| 30 |
+
'17', # Meghalaya
|
| 31 |
+
'18', # Assam
|
| 32 |
+
'19', # West Bengal
|
| 33 |
+
'20', # Jharkhand
|
| 34 |
+
'21', # Odisha
|
| 35 |
+
'22', # Chhattisgarh
|
| 36 |
+
'23', # Madhya Pradesh
|
| 37 |
+
'24', # Gujarat
|
| 38 |
+
'25', # Daman & Diu
|
| 39 |
+
'26', # Dadra & Nagar Haveli
|
| 40 |
+
'27', # Maharashtra
|
| 41 |
+
'28', # Andhra Pradesh
|
| 42 |
+
'29', # Karnataka
|
| 43 |
+
'30', # Goa
|
| 44 |
+
'31', # Lakshadweep
|
| 45 |
+
'32', # Kerala
|
| 46 |
+
'33', # Tamil Nadu
|
| 47 |
+
'34', # Puducherry
|
| 48 |
+
'35', # Andaman & Nicobar Islands
|
| 49 |
+
'36', # Telangana
|
| 50 |
+
'37' # Ladakh (added in newer datasets)
|
| 51 |
]
|
| 52 |
|
| 53 |
+
|
| 54 |
def is_valid_udise(code):
|
| 55 |
"""Check if a string is a valid UDISE code."""
|
| 56 |
if not (code and code.isdigit() and len(code) == 11):
|