Skip to content

Commit

Permalink
feat: Init save_to_json func
Browse files Browse the repository at this point in the history
  • Loading branch information
haruki7049 committed Jul 17, 2024
1 parent 1668ece commit 841f450
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fetch-releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,18 @@ def get_all_releases(owner: str, repo: str) -> list:
break

return releases


def save_to_json(sources: dict, filename: str):
"""
Save json to a file
Parameters
----------
json : list
JSON data which will be saved to a file
filename : str
File name to save the JSON data
"""
with open(filename, "w") as file:
json.dump(sources, file, indent=2)

0 comments on commit 841f450

Please sign in to comment.