Skip to main content
Glama
geographic_scope.py1.4 kB
"""Geographic scope value object.""" from enum import Enum class GeographicScope(str, Enum): """Geographic scope for indicators. Attributes: PENINSULAR: Peninsular Spain (mainland) NATIONAL: All Spain (including islands) CANARIAS: Canary Islands BALEARES: Balearic Islands CEUTA: Ceuta MELILLA: Melilla """ PENINSULAR = "Península" NATIONAL = "Nacional" CANARIAS = "Canarias" BALEARES = "Baleares" CEUTA = "Ceuta" MELILLA = "Melilla" @classmethod def from_geo_name(cls, geo_name: str | None) -> "GeographicScope": """Create from API geo_name field. Args: geo_name: Geographic name from API Returns: Corresponding GeographicScope, defaults to PENINSULAR. """ if not geo_name: return cls.PENINSULAR geo_lower = geo_name.lower() if "península" in geo_lower or "peninsular" in geo_lower: return cls.PENINSULAR elif "nacional" in geo_lower: return cls.NATIONAL elif "canarias" in geo_lower: return cls.CANARIAS elif "baleares" in geo_lower: return cls.BALEARES elif "ceuta" in geo_lower: return cls.CEUTA elif "melilla" in geo_lower: return cls.MELILLA else: return cls.PENINSULAR

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ESJavadex/ree-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server