cowidev.yougov

cowidev.yougov.__main__

class cowidev.yougov.__main__.YouGov(output_path: str, debug: bool = False)[source]

Bases: object

_get_source_url_country(country, extension)[source]
_read_country_from_web(source_url_country, extension)[source]

Given URL, reads individual country data.

export()[source]
property list_countries

Get list of countries to download.

property output_csv_path
property output_csv_path_composite
pipeline_csv(df: DataFrame)[source]
read()[source]

Read data. Reads multiple countries and concatenates them into one file.

read_country(country)[source]

Read individual country data.

property source_url_master
cowidev.yougov.__main__._aggregate(df)[source]
cowidev.yougov.__main__._create_composite_cols(df)[source]
cowidev.yougov.__main__._derive_cols(df)[source]
cowidev.yougov.__main__._format_date(df: DataFrame)[source]
cowidev.yougov.__main__._preprocess_cols(df)[source]
cowidev.yougov.__main__._rename_columns(df)[source]
cowidev.yougov.__main__._reorder_columns(df)[source]
cowidev.yougov.__main__._round(df)[source]
cowidev.yougov.__main__._standardize_entities(df)[source]
cowidev.yougov.__main__._subset_and_rename_columns(df)[source]

keeps only the survey questions with keep=True in mapping.csv and renames columns. Note: we do not use df.rename(columns={…}) because for some columns we

derive multiple variables.

cowidev.yougov.__main__.main()[source]

python -m cowidev.yougov