from pathlib import Path
import json


def write_json_file(path, json_data):
    """Write json to a file"""
    path = Path(path)

    with path.open("w") as file:
        json_file = json.dump(json_data, file)
        return json_file