-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
download and sort json from prefix.cc with python script in custom task
- Loading branch information
1 parent
345dffc
commit 7ce1c24
Showing
3 changed files
with
12 additions
and
14 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 was deleted.
Oops, something went wrong.
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,11 @@ | ||
"""Helper script to sort prefixes in task custom:update_prefixes""" | ||
|
||
from json import dump, loads | ||
from pathlib import Path | ||
from urllib.request import urlopen | ||
|
||
with urlopen('http://prefix.cc/popular/all.file.json') as f: | ||
json_data = loads(f.read().decode('utf-8')) | ||
|
||
with (Path("cmem_plugin_shapes") / "prefix.cc.json").open("w") as json_file: | ||
dump(json_data, json_file, sort_keys=True, indent=2) |