Spaces:
Sleeping
Sleeping
Commit ·
6cc9a07
1
Parent(s): 67a5ce1
Sort CSV aliases by UDISE code on save
Browse files- alias_store.py +3 -0
alias_store.py
CHANGED
|
@@ -114,6 +114,9 @@ def save_aliases(new_entries: list[dict]) -> str:
|
|
| 114 |
return f"ℹ️ All {skipped_count} name(s) already in CSV — nothing new to save."
|
| 115 |
|
| 116 |
df = pd.concat([df, pd.DataFrame(new_rows)], ignore_index=True)
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
# Upload to HF
|
| 119 |
try:
|
|
|
|
| 114 |
return f"ℹ️ All {skipped_count} name(s) already in CSV — nothing new to save."
|
| 115 |
|
| 116 |
df = pd.concat([df, pd.DataFrame(new_rows)], ignore_index=True)
|
| 117 |
+
|
| 118 |
+
# Sort by UDISE so all aliases for the same school are grouped together in Excel
|
| 119 |
+
df = df.sort_values(by=["UDISE_Code", "Source"]).reset_index(drop=True)
|
| 120 |
|
| 121 |
# Upload to HF
|
| 122 |
try:
|