Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
Add BO vaccinations data source
Browse files Browse the repository at this point in the history
  • Loading branch information
owahltinez committed Apr 2, 2021
1 parent 9ad2ba6 commit f32a3a3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/table-vaccinations.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ counts over time, which is why the cumulative values, if reported, are kept in a
| Australia | [COVID LIVE](https://covidlive.com.au/) | [CC BY](https://creativecommons.org/licenses/by/4.0/) | Country level data is not the sum of the states/territories as there is a portion of vaccinations managed by the Federal government that is delivered directly to aged and disability care and not counted as part of the states/territories|
| Austria | [Open Data Österreich](https://www.data.gv.at/covid-19/) | [CC BY](https://www.data.gv.at/covid-19/) | |
| Belgium | [Covid Vaccinations Belgium](https://covid-vaccinatie.be/en) | [CC BY](https://covid-vaccinatie.be/api) | Regional data only available for Brussels, since the regions reported by the data source do not match our indexed subregions |
| Bolivia | [Ministry of Health](https://www.minsalud.gob.bo/) (via [FinMango][1]) | [CC BY](https://finmango.org/covid) | |
| Brazil | Secretarias de Saúde via [FinMango][1] | [CC BY][1] | |
| Brazil | [Brazil Ministério da Saúde](https://coronavirus.saude.gov.br/) | [Creative Commons Atribuição](http://www.opendefinition.org/licenses/cc-by) | |
| Bulgaria | [Ministry of Health](https://coronavirus.bg/bg/statistika) (via [FinMango][1]) | [CC BY](https://finmango.org/covid) | |
Expand Down
40 changes: 40 additions & 0 deletions src/pipelines/vaccinations/bo_finmango.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict
from pandas import DataFrame
from lib.cast import safe_int_cast
from lib.data_source import DataSource
from lib.utils import table_rename
from pipelines.epidemiology.de_authority import _SUBREGION1_CODE_MAP


_column_adapter = {
"Date": "date",
"Department": "match_string",
"First Dose": "total_persons_vaccinated",
"Second Dose": "total_persons_fully_vaccinated",
}


class FinMangoBoliviaDataSource(DataSource):
def parse_dataframes(
self, dataframes: Dict[Any, DataFrame], aux: Dict[str, DataFrame], **parse_opts
) -> DataFrame:
data = table_rename(dataframes[0], _column_adapter, drop=True)

data["country_code"] = "BO"
data["locality_code"] = None
data["subregion2_code"] = None
return data
16 changes: 16 additions & 0 deletions src/pipelines/vaccinations/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ sources:
job_group: all
deferred: true

# Data sources for BO levels 0 + 1
- name: pipelines.vaccinations.bo_finmango.FinMangoBoliviaDataSource
fetch:
- url: "https://docs.google.com/spreadsheets/d/e/2PACX-1vTQPaCIPwOdo-ELdSPlRSlLWqB0X3PtpZJdB1aEIjdo_HBW2qAe_9bY6rE3t_AMakUPNk2TPuwzPKx_/pub?gid=0&single=true&output=csv"
opts:
ext: csv
aggregate:
subregion1: ["total_persons_vaccinated", "total_persons_fully_vaccinated", "total_vaccine_doses_administered"]
test:
location_key_match:
- '^BO$'
- '^BO_[^_]+$'
automation:
job_group: all
deferred: true

# Data sources for BR levels 0 + 1 + 2
- name: pipelines.vaccinations.br_authority.BrazilDataSource
fetch:
Expand Down

0 comments on commit f32a3a3

Please sign in to comment.