-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andraz Vrhovec
committed
Apr 2, 2021
1 parent
bd0ed02
commit cad3ab1
Showing
6 changed files
with
232 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
import requests | ||
from .data import _source, _headers, _vaccinations_by_day_req, _vaccinations_by_age_req, _vaccines_supplied_and_used_req, _vaccinations_by_region_req | ||
from .parser import _parse_vaccinations_by_age, _parse_vaccinations_by_day, _parse_vaccines_supplued_and_used, _parse_vaccinations_by_region | ||
from .data import _source, _headers, _vaccinations_by_day_req, _vaccinations_by_age_req, _vaccines_supplied_and_used_req, _vaccinations_by_region_req, _vaccines_supplied_by_manufacturer_req | ||
from .parser import _parse_vaccinations_by_age, _parse_vaccinations_by_day, _parse_vaccines_supplued_and_used, _parse_vaccinations_by_region, _parse_vaccines_supplied_by_manufacturer | ||
|
||
from .types import VaccinationByAgeRow, VaccinationByDayRow, VaccineSupplyUsage, VaccinationByRegionRow, VaccinationByManufacturerRow | ||
|
||
from .types import VaccinationByAgeRow, VaccinationByDayRow, VaccineSupplyUsage, VaccinationByRegionRow | ||
|
||
def _get_data(req, parse_response): | ||
resp = requests.post(_source, headers=_headers, json=req) | ||
resp.raise_for_status() | ||
return parse_response(resp.json()) | ||
|
||
|
||
|
||
|
||
def vaccinations_by_day() -> 'list[VaccinationByDayRow]': | ||
return _get_data(_vaccinations_by_day_req, _parse_vaccinations_by_day) | ||
|
||
|
||
def vaccinations_by_age() -> 'list[VaccinationByAgeRow]': | ||
return _get_data(_vaccinations_by_age_req, _parse_vaccinations_by_age) | ||
|
||
|
||
def vaccines_supplied_and_used() -> 'list[VaccineSupplyUsage]': | ||
return _get_data(_vaccines_supplied_and_used_req, _parse_vaccines_supplued_and_used) | ||
|
||
|
||
def vaccinations_by_region() -> 'list[VaccinationByRegionRow]': | ||
return _get_data(_vaccinations_by_region_req, _parse_vaccinations_by_region) | ||
return _get_data(_vaccinations_by_region_req, _parse_vaccinations_by_region) | ||
|
||
|
||
def vaccines_supplied_by_manufacturer() -> 'list[VaccinationByManufacturerRow]': | ||
return _get_data(_vaccines_supplied_by_manufacturer_req, _parse_vaccines_supplied_by_manufacturer) |
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,7 +1,7 @@ | ||
[metadata] | ||
# replace with your username: | ||
name = cepimose | ||
version = 0.0.3 | ||
version = 0.0.4 | ||
author = sledilnik.org | ||
author_email = [email protected] | ||
description = A small example package to get raw data from NIJZ vaccinations dashboard | ||
|