from typing import Any
from functools import reduce


def deep_get(dictionary: dict, path: str, default: Any = None) -> Any:
    """Safely parse a dict to return the value located at the given path.

    Args:
      dictionary:
        The dictionary to get the value from.
      path:
        The path of the value to fetch.
      default:
        The default value to return if no value is found.

    Returns:
      The value found in the dictionary path, or the default one if
      nothing is found.
    """

    return reduce(
        lambda d, key: d.get(key, default) if isinstance(d, dict) else default,
        path.split("."),
        dictionary,
    )