-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix key communities script * Blackify * Scriptify download command * More fixing scripts
- Loading branch information
Showing
3 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
Download key communities CSV file if it isn't there | ||
""" | ||
from pathlib import Path | ||
import urllib.request | ||
|
||
# URL of the file to download | ||
file_url = 'https://compass.2i2c.org/_downloads/8fa10f7f661246ec4fbe1515e254aa6d/key-communities.toml' | ||
file_local = Path("../data/key-communities.toml") | ||
|
||
# Open the URL | ||
if not file_local.exists(): | ||
with urllib.request.urlopen(file_url) as response: | ||
# Read the content of the response | ||
file_content = response.read() | ||
file_local.write_bytes(file_content) | ||
print(f"Downloaded new key communities file to: {file_local}") | ||
else: | ||
print(f"Key communities file already exists at: {file_local}, skipping download...") |