from pathlib import Path


def get_datafile_path(file_name):
    """
    Get the path to the datafile by searching the current directory for a file
    with the given name and the '.json' extension.
    @param file_name: the name of the file whose path is required
    @return: the path to the file
    """

    current_file = Path(__file__).resolve()
    data_file = current_file.parent.joinpath(f"{file_name}.json")
    return data_file