from pathlib import Path import json def dump_repo(repo_path: Path, repo_data: dict): with (repo_path / 'repo.json').open('w', encoding='utf-8') as repo_file: json.dump(repo_data, repo_file, indent=4, sort_keys=True)