-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_embassies.py
More file actions
executable file
·53 lines (42 loc) · 1.42 KB
/
check_embassies.py
File metadata and controls
executable file
·53 lines (42 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
"""
Quick script to check embassy list statistics
"""
import json
from pathlib import Path
from collections import Counter
def main():
embassies_path = Path(__file__).parent / 'embassies.json'
with open(embassies_path, 'r', encoding='utf-8') as f:
embassies = json.load(f)
print("=" * 60)
print("Embassy List Statistics")
print("=" * 60)
print()
print(f"Total embassies: {len(embassies)}")
print()
# Count by city
cities = Counter(e['city'] for e in embassies)
print("Embassies by city:")
for city, count in cities.most_common():
print(f" {city}: {count}")
print()
# Check for excluded countries
excluded = ['Taiwan', 'Netherlands', 'Russia', 'Holland', 'Nederland']
found_excluded = [e for e in embassies if any(exc.lower() in e['country'].lower() for exc in excluded)]
if found_excluded:
print("⚠️ WARNING: Found excluded countries in list:")
for e in found_excluded:
print(f" - {e['country']}")
else:
print("✓ Confirmed: No excluded countries (Taiwan, Netherlands, Russia) in list")
print()
# List all countries
print("All countries in list:")
print("-" * 60)
for i, embassy in enumerate(embassies, 1):
print(f"{i:3d}. {embassy['country']:<30} ({embassy['city']}) - {embassy['email']}")
print()
print("=" * 60)
if __name__ == "__main__":
main()