(api_key: str, path: str = ".")
| 18 | |
| 19 | |
| 20 | def save_apod(api_key: str, path: str = ".") -> dict: |
| 21 | apod_data = get_apod_data(api_key) |
| 22 | img_url = apod_data["url"] |
| 23 | img_name = img_url.split("/")[-1] |
| 24 | response = httpx.get(img_url, timeout=10) |
| 25 | |
| 26 | with open(f"{path}/{img_name}", "wb+") as img_file: |
| 27 | img_file.write(response.content) |
| 28 | del response |
| 29 | return apod_data |
| 30 | |
| 31 | |
| 32 | def get_archive_data(query: str) -> dict: |
no test coverage detected