def page_to_offset(page: int, per_page: int, zero_offset: int = 1) -> int:
    """Calculate offset from ``page`` and ``per_page``

    Args:
        page (int): page number (1 based)
        per_page (int): items per page
        zero_offset (int, optional): Offset from zero, e.g. if your engine 
            starts counting from 0, set this to 0. Defaults to 1.

    Returns:
        int: The offset of items
    """

    return (page-1)*per_page+zero_offset