Module valolyticspy.services.helper.ceremony_from_roundCeremony

Expand source code
import sys
sys.path.append("")

from valolyticspy.services.dto_loader import ValorantDTO
from valolyticspy.dtos.valorant_api.ceremony import Ceremony

def get_ceremony_from_roundCeremony(roundCeremony:str) -> Ceremony:
    """
    Retrieves the Ceremony object based on the given roundCeremony string.

    Args:
        roundCeremony (str): The roundCeremony string to search for.

    Returns:
        Ceremony: The Ceremony object corresponding to the roundCeremony string, or None if not found.
    """
    if roundCeremony == "Default":
        return ValorantDTO.CEREMONIES["00000000-0000-0000-0000-000000000000"]
    for ceremony in ValorantDTO.CEREMONIES.values():
        if(f"Ceremony{ceremony.displayName.capitalize()}" == roundCeremony):
            return ceremony
    return None

Functions

def get_ceremony_from_roundCeremony(roundCeremony: str) ‑> Ceremony

Retrieves the Ceremony object based on the given roundCeremony string.

Args

roundCeremony : str
The roundCeremony string to search for.

Returns

Ceremony
The Ceremony object corresponding to the roundCeremony string, or None if not found.
Expand source code
def get_ceremony_from_roundCeremony(roundCeremony:str) -> Ceremony:
    """
    Retrieves the Ceremony object based on the given roundCeremony string.

    Args:
        roundCeremony (str): The roundCeremony string to search for.

    Returns:
        Ceremony: The Ceremony object corresponding to the roundCeremony string, or None if not found.
    """
    if roundCeremony == "Default":
        return ValorantDTO.CEREMONIES["00000000-0000-0000-0000-000000000000"]
    for ceremony in ValorantDTO.CEREMONIES.values():
        if(f"Ceremony{ceremony.displayName.capitalize()}" == roundCeremony):
            return ceremony
    return None