wrongmove/services/district_service.py
Viktor Barzin eafbc1ac52
Flatten repo structure: move crawler/ to root, remove vqa/ and immoweb/
The crawler subdirectory was the only active project. Moving it to the
repo root simplifies paths and removes the unnecessary nesting. The
vqa/ and immoweb/ directories were legacy/unused and have been removed.

Updated .drone.yml, .gitignore, .claude/ docs, and skills to reflect
the new flat structure.
2026-02-07 23:01:20 +00:00

37 lines
971 B
Python

"""Unified district service - shared between CLI and HTTP API."""
from rec.districts import get_districts as _get_districts
def get_all_districts() -> dict[str, str]:
"""Get all available districts with their region IDs.
Used by:
- CLI: --district option choices
- API: GET /api/get_districts
Returns:
Dictionary mapping district names to region IDs
"""
return _get_districts()
def get_district_names() -> list[str]:
"""Get list of all district names.
Returns:
List of district names
"""
return list(_get_districts().keys())
def validate_districts(district_names: list[str]) -> list[str]:
"""Validate that district names exist.
Args:
district_names: List of district names to validate
Returns:
List of invalid district names (empty if all valid)
"""
valid_districts = set(_get_districts().keys())
return [d for d in district_names if d not in valid_districts]