-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from eDatos/new-indicators
New indicators
- Loading branch information
Showing
9 changed files
with
84 additions
and
76 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
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 |
---|---|---|
@@ -1,29 +1,31 @@ | ||
from collections import defaultdict | ||
|
||
import notification | ||
import scraping | ||
import settings | ||
import storage | ||
import wrangling | ||
import notification | ||
from collections import defaultdict | ||
|
||
print('Downloading codelist...') | ||
storage.download_codelist(settings.CODELIST_FILENAME) | ||
print('Downloading dataref file...') | ||
codelists, datasets_urls = storage.download_dataref() | ||
|
||
print('Converting codelists to dict mapping...') | ||
codelists = wrangling.codelists_to_dict(codelists) | ||
|
||
uploaded_files = defaultdict(list) | ||
|
||
for dataset_url in scraping.get_datasets_urls(settings.TARGET_URL): | ||
for dataset_url in datasets_urls: | ||
print(f'Downloading {dataset_url}...') | ||
dataset = scraping.download_dataset(dataset_url) | ||
|
||
print(f'Staging {dataset}...') | ||
output_files = wrangling.stage_dataset(dataset) | ||
|
||
print('Uploading output files...') | ||
for file in output_files: | ||
download_url = storage.upload(file) | ||
filename = file.name | ||
uploaded_files[dataset.stem].append((filename, download_url)) | ||
print(f"{filename} -> {download_url}") | ||
print() | ||
if output_files := wrangling.stage_dataset(dataset, codelists): | ||
print('Uploading output files...') | ||
for file in output_files: | ||
download_url = storage.upload(file) | ||
filename = file.name | ||
uploaded_files[dataset.stem].append((filename, download_url)) | ||
print(f"{filename} -> {download_url}") | ||
print() | ||
|
||
print('Notifying results...') | ||
notification.notify(uploaded_files) |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
selenium | ||
pandas | ||
prettyconf | ||
yagdrive | ||
|
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
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