cowidev.jhu

cowidev.jhu.__main__

Collect JHU Cases/Deaths data

cowidev.jhu.__main__.check_data_correctness(df, logger, server)[source]

Check that everything is alright in df

cowidev.jhu.__main__.download_csv(logger)[source]
cowidev.jhu.__main__.export(df, logger)[source]
cowidev.jhu.__main__.generate_dataset(logger, server_mode, skip_download=False)[source]
cowidev.jhu.__main__.update_db()[source]

cowidev.jhu._parser

cowidev.jhu._parser._parse_args()[source]

cowidev.jhu.load

cowidev.jhu.load._correct_regions(df: DataFrame)[source]

Correct region names

cowidev.jhu.load._find_closest_year_row(df, year=2021)[source]

Returns the row which is closest to the year specified (in either direction)

cowidev.jhu.load._format_date(df: DataFrame)[source]

Format date

cowidev.jhu.load._get_daily_metric(df: DataFrame, metric: str)[source]

Get daily metric

cowidev.jhu.load._get_metric(metric, region)[source]

Read metric from raw JHU data files.

cowidev.jhu.load._load_raw_data()[source]

Load raw data

cowidev.jhu.load._load_raw_locations()[source]

Load location data

cowidev.jhu.load._start_cutoff(df: DataFrame, metric: str)[source]

Only start country series when total_cases > 0 or total_deaths > 0 to minimize file size

cowidev.jhu.load._subregion_to_region(df: DataFrame)[source]

Subregions to regions

cowidev.jhu.load.load_data()[source]

Load JHU data

cowidev.jhu.load.load_eu_country_names()[source]
cowidev.jhu.load.load_owid_continents()[source]
cowidev.jhu.load.load_population(year=2021)[source]
cowidev.jhu.load.load_wb_income_groups()[source]

cowidev.jhu.process

cowidev.jhu.process._apply_row_cfr_100(row)[source]
cowidev.jhu.process._date_diff(a, b, positive_only=False)[source]
cowidev.jhu.process._days_since(df, spec)[source]
cowidev.jhu.process._get_date_of_threshold(df, col, threshold)[source]
cowidev.jhu.process._inject_growth(df, prefix, periods)[source]
cowidev.jhu.process._sum_aggregate(df, name, include=None, exclude=None)[source]
cowidev.jhu.process.discard_rows(df)[source]
cowidev.jhu.process.drop_population(df)[source]
cowidev.jhu.process.existsin(l1, l2)[source]
cowidev.jhu.process.hide_recent_zeros(df: DataFrame) DataFrame[source]
cowidev.jhu.process.inject_biweekly_growth(df)[source]
cowidev.jhu.process.inject_cfr(df)[source]
cowidev.jhu.process.inject_days_since(df)[source]
cowidev.jhu.process.inject_doubling_days(df)[source]
cowidev.jhu.process.inject_exemplars(df)[source]
cowidev.jhu.process.inject_owid_aggregates(df)[source]
cowidev.jhu.process.inject_per_million(df, measures)[source]
cowidev.jhu.process.inject_population(df)[source]
cowidev.jhu.process.inject_rolling_avg(df)[source]
cowidev.jhu.process.inject_total_daily_cols(df, measures)[source]
cowidev.jhu.process.inject_weekly_growth(df)[source]
cowidev.jhu.process.pct_change_to_doubling_days(pct_change, periods)[source]
cowidev.jhu.process.standard_export(df, output_path, grapher_name)[source]
cowidev.jhu.process.standardize_data(df)[source]

cowidev.jhu.subnational

cowidev.jhu.subnational.clean_global_subnational(metric)[source]
cowidev.jhu.subnational.clean_us_subnational(metric)[source]
cowidev.jhu.subnational.create_subnational()[source]

cowidev.jhu.utils

cowidev.jhu.utils.print_err(*args, **kwargs)[source]

TODO: This module is a work in progress