gkdivya commited on
Commit
f85ee0d
·
verified ·
1 Parent(s): 1a0de33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -5
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
- '11', '12', '13', '14', '15', '16', '17', '18', '19', # Northern
15
- '20', '21', '22', '23', '24', '25', '26', '27', '28', # Western
16
- '29', '30', '31', '32', '33', '34', '35', '36', # Southern
17
- '37', '38', '39', '40', '41', '42', '43', '44', # Eastern
18
- '45', '46', '47', '48', '49', '50', '51', '52' # North-Eastern & UTs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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):