Skip to content

MerakiCDNClient

from pulsefire.clients import MerakiCDNClient

Bases: BaseClient

Meraki CDN Client.

Resources Support
League of Legends
Legends of Runeterra
Teamfight Tactics
Valorant

Does not support versioning by patch.

Example:

async with MerakiCDNClient() as client:
    champion = await client.get_lol_champion(key="Yone")
    assert champion["id"] == 777

Source code in pulsefire/clients.py
class MerakiCDNClient(BaseClient):
    """Meraki CDN Client.

    | Resources            | Support                    |
    | -------------------- | -------------------------- |
    | League of Legends    | ✅                         |
    | Legends of Runeterra | ❎                         |
    | Teamfight Tactics    | ❎                         |
    | Valorant             | ❎                         |

    Does not support versioning by patch.

    Example:
    ```python
    async with MerakiCDNClient() as client:
        champion = await client.get_lol_champion(key="Yone")
        assert champion["id"] == 777
    ```
    """

    def __init__(
        self,
        *,
        base_url: str = "https://cdn.merakianalytics.com/riot",
        default_params: dict[str, Any] = {},
        default_headers: dict[str, str] = {},
        default_queries: dict[str, str] = {},
        middlewares: list[Middleware] = [
            json_response_middleware(),
            http_error_middleware(),
        ],
    ) -> None:
        super().__init__(
            base_url=base_url,
            default_params=default_params,
            default_headers=default_headers,
            default_queries=default_queries,
            middlewares=middlewares
        )

    async def get_lol_champions(self) -> dict[str, MerakiCDNSchema.LolChampion]:
        return await self.invoke("GET", "/lol/resources/latest/en-US/champions.json")

    async def get_lol_champion(self, *, key: str = ...) -> MerakiCDNSchema.LolChampion:
        return await self.invoke("GET", "/lol/resources/latest/en-US/champions/{key}.json")

    async def get_lol_items(self) -> dict[str, MerakiCDNSchema.LolItem]:
        return await self.invoke("GET", "/lol/resources/latest/en-US/items.json")

    async def get_lol_item(self, *, id: int = ...) -> MerakiCDNSchema.LolItem:
        return await self.invoke("GET", "/lol/resources/latest/en-US/items/{id}.json")

    async def get_lol_champion_rates(self) -> MerakiCDNSchema.LolChampionRates:
        return await self.invoke("GET", "/lol/resources/latest/en-US/championrates.json")
Functions
__init__
__init__(
    *,
    base_url: str = "https://cdn.merakianalytics.com/riot",
    default_params: dict[str, Any] = {},
    default_headers: dict[str, str] = {},
    default_queries: dict[str, str] = {},
    middlewares: list[Middleware] = [
        json_response_middleware(),
        http_error_middleware(),
    ]
) -> None
Source code in pulsefire/clients.py
def __init__(
    self,
    *,
    base_url: str = "https://cdn.merakianalytics.com/riot",
    default_params: dict[str, Any] = {},
    default_headers: dict[str, str] = {},
    default_queries: dict[str, str] = {},
    middlewares: list[Middleware] = [
        json_response_middleware(),
        http_error_middleware(),
    ],
) -> None:
    super().__init__(
        base_url=base_url,
        default_params=default_params,
        default_headers=default_headers,
        default_queries=default_queries,
        middlewares=middlewares
    )
get_lol_champions async
get_lol_champions() -> dict[str, MerakiCDNSchema.LolChampion]
Source code in pulsefire/clients.py
async def get_lol_champions(self) -> dict[str, MerakiCDNSchema.LolChampion]:
    return await self.invoke("GET", "/lol/resources/latest/en-US/champions.json")
get_lol_champion async
get_lol_champion(*, key: str = ...) -> MerakiCDNSchema.LolChampion
Source code in pulsefire/clients.py
async def get_lol_champion(self, *, key: str = ...) -> MerakiCDNSchema.LolChampion:
    return await self.invoke("GET", "/lol/resources/latest/en-US/champions/{key}.json")
get_lol_items async
get_lol_items() -> dict[str, MerakiCDNSchema.LolItem]
Source code in pulsefire/clients.py
async def get_lol_items(self) -> dict[str, MerakiCDNSchema.LolItem]:
    return await self.invoke("GET", "/lol/resources/latest/en-US/items.json")
get_lol_item async
get_lol_item(*, id: int = ...) -> MerakiCDNSchema.LolItem
Source code in pulsefire/clients.py
async def get_lol_item(self, *, id: int = ...) -> MerakiCDNSchema.LolItem:
    return await self.invoke("GET", "/lol/resources/latest/en-US/items/{id}.json")
get_lol_champion_rates async
get_lol_champion_rates() -> MerakiCDNSchema.LolChampionRates
Source code in pulsefire/clients.py
async def get_lol_champion_rates(self) -> MerakiCDNSchema.LolChampionRates:
    return await self.invoke("GET", "/lol/resources/latest/en-US/championrates.json")