world package

world is the main API of the worldometer package, where you can access various live counters and data available on the https://www.worldometers.info website through self-descriptive classes, methods, and attributes.

Live Counters

Get the data provided by the live counters.

Each section is represented by an attribute in the WorldCounters class, and these attributes are instances of data classes that store the counter values.

Each of these data classes has attributes that describe the data stored in them.

>>> from worldometer.world import WorldCounters

>>> wc = WorldCounters()

>>> wc.world_population.current_population
8065299074

>>> wc.government_and_economics.computers_produced_this_year
180248430

>>> wc.society_and_media.internet_users_in_the_world_today
5895566559
class worldometer.world.counters.WorldCounters

Contains a reference to each section of the home page counters.

source_path

The source path for the counters.

Type:

str

world_population

An instance of the WorldPopulation class that stores all counters related to population data.

Type:

WorldPopulation

government_and_economics

An instance of the GovernmentAndEconomics class that stores all counters related to government and economic data.

Type:

GovernmentAndEconomics

society_and_media

An instance of the SocietyAndMedia class that stores all counters related to society and media data.

Type:

SocietyAndMedia

environment

An instance of the Environment class that stores all counters related to environmental data.

Type:

Environment

food

An instance of the Food class that stores all counters related to food data.

Type:

Food

water

An instance of the Water class that stores all counters related to water data.

Type:

Water

energy

An instance of the Energy class that stores all counters related to energy data.

Type:

Energy

health

An instance of the Health class that stores all counters related to health data.

Type:

Health

Notes

For precise and up-to-date information on each section and its counters, please check the worldometers homepage.

class worldometer.world.counters.WorldPopulation(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to world population data.

current_population
Type:

Union[int, float, None]

births_today
Type:

Union[int, float, None]

births_this_year
Type:

Union[int, float, None]

deaths_today
Type:

Union[int, float, None]

deaths_this_year
Type:

Union[int, float, None]

net_population_growth_today
Type:

Union[int, float, None]

net_population_growth_this_year
Type:

Union[int, float, None]

class worldometer.world.counters.GovernmentAndEconomics(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to government and economic data.

public_healthcare_expenditure_today
Type:

Union[int, float, None]

public_education_expenditure_today
Type:

Union[int, float, None]

public_military_expenditure_today
Type:

Union[int, float, None]

cars_produced_this_year
Type:

Union[int, float, None]

bicycles_produced_this_year
Type:

Union[int, float, None]

computers_produced_this_year
Type:

Union[int, float, None]

class worldometer.world.counters.SocietyAndMedia(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to society and media data.

new_book_titles_published_this_year
Type:

Union[int, float, None]

newspapers_circulated_today
Type:

Union[int, float, None]

tv_sets_sold_worldwide_today
Type:

Union[int, float, None]

cellular_phones_sold_today
Type:

Union[int, float, None]

money_spent_on_videogames_today
Type:

Union[int, float, None]

internet_users_in_the_world_today
Type:

Union[int, float, None]

emails_sent_today
Type:

Union[int, float, None]

blog_posts_written_today
Type:

Union[int, float, None]

tweets_sent_today
Type:

Union[int, float, None]

google_searches_today
Type:

Union[int, float, None]

class worldometer.world.counters.Environment(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to environmental data.

forest_loss_this_year
Type:

Union[int, float, None]

land_lost_to_soil_erosion_this_year
Type:

Union[int, float, None]

co2_emissions_this_year
Type:

Union[int, float, None]

desertification_this_year
Type:

Union[int, float, None]

toxic_chemicals_released_in_the_environment_this_year
Type:

Union[int, float, None]

class worldometer.world.counters.Food(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to food data.

undernourished_people_in_the_world
Type:

Union[int, float, None]

overweight_people_in_the_world
Type:

Union[int, float, None]

obese_people_in_the_world
Type:

Union[int, float, None]

people_who_died_of_hunger_today
Type:

Union[int, float, None]

Type:

Union[int, float, None]

money_spent_on_weight_loss_programs_in_the_usa_today
Type:

Union[int, float, None]

class worldometer.world.counters.Water(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to water data.

water_used_this_year
Type:

Union[int, float, None]

Type:

Union[int, float, None]

people_with_no_access_to_a_safe_drinking_water_source
Type:

Union[int, float, None]

class worldometer.world.counters.Energy(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to energy data.

energy_used_today
Type:

Union[int, float, None]

non_renewable_sources
Type:

Union[int, float, None]

renewable_sources
Type:

Union[int, float, None]

solar_energy_striking_earth_today
Type:

Union[int, float, None]

oil_pumped_today
Type:

Union[int, float, None]

oil_left
Type:

Union[int, float, None]

days_to_the_end_of_oil
Type:

Union[int, float, None]

natural_gas_left
Type:

Union[int, float, None]

days_to_the_end_of_natural_gas
Type:

Union[int, float, None]

coal_left
Type:

Union[int, float, None]

days_to_the_end_of_coal
Type:

Union[int, float, None]

class worldometer.world.counters.Health(_data: dataclasses.InitVar[Dict[str, Union[int, float, NoneType]]])

Counters related to health data.

communicable_disease_deaths_this_year
Type:

Union[int, float, None]

seasonal_flu_deaths_this_year
Type:

Union[int, float, None]

deaths_of_children_under_5_this_year
Type:

Union[int, float, None]

abortions_this_year
Type:

Union[int, float, None]

deaths_of_mothers_during_birth_this_year
Type:

Union[int, float, None]

hiv_aids_infected_people
Type:

Union[int, float, None]

deaths_caused_by_hiv_aids_this_year
Type:

Union[int, float, None]

deaths_caused_by_cancer_this_year
Type:

Union[int, float, None]

deaths_caused_by_malaria_this_year
Type:

Union[int, float, None]

cigarettes_smoked_today
Type:

Union[int, float, None]

deaths_caused_by_smoking_this_year
Type:

Union[int, float, None]

deaths_caused_by_alcohol_this_year
Type:

Union[int, float, None]

suicides_this_year
Type:

Union[int, float, None]

money_spent_on_illegal_drugs_this_year
Type:

Union[int, float, None]

road_traffic_accident_fatalities_this_year
Type:

Union[int, float, None]

Country Codes

All countries have specific codes that represent them in some way. Get all of these codes with the CountryCodes class:

>>> from worldometer.world import CountryCodes

>>> cc = CountryCodes()

>>> cc.data[0]
CountryCodesData(
    country='Afghanistan',
    calling_code='93',
    three_letter_iso='AF',
    two_letter_iso='AFG',
    three_digit_iso_numeric=4
)
class worldometer.world.country_codes.CountryCodes

Represents the data table of some codes used by each country.

source_path

The data source path.

Type:

str

new_column_names

The new column names that will be used to replace those of the original table.

Type:

tuple

Notes

Check the source table in Worldometers Country Codes.

property data: List[CountryCodesData]

Get a list of all the data from the table.

Each index in the list contains an object representing a data row of the table.

class worldometer.world.country_codes.CountryCodesData(country: str, calling_code: str, three_letter_iso: str, two_letter_iso: str, three_digit_iso_numeric: str)

Represents a data row from the respective table.

country
Type:

str

calling_code
Type:

str

three_letter_iso
Type:

str

two_letter_iso
Type:

str

three_digit_iso_numeric
Type:

str