djay / covidthailand

Thailand Covid testing and case data gathered and combined from various sources for others to download or view
126 stars 15 forks source link
ccsa-daily-briefing confirmed-cases covid-api covid19-data daily-situation-reports hacktoberfest hacktoberfest2021 health-district proactive-tests thailand

Thailand COVID-19 Data

Note Share via https://djay.github.io/covidthailand

Thailand COVID-19 case/test/vaccination data gathered and combined from various government sources for others to view or download.

Cases | Deaths | Vaccinations | Active Cases | Testing | Downloads | About

NEW Excess Deaths

Disclaimer

Data offered here is offered as is with no guarantees. As much as possible government reports and data feeds have been used effort has gone into making this data collection accurate and timely. This sites only intention is to give an accurate representation of all the available Covid data for Thailand in one place.

Links to all data sources are including in Downloads


Questions?

Got a question about covid in Thailand? Try asking it in Q&A discussion

Weekly data from Oct 1st

From Oct 1st 2022 all covid data from the DDC has been released in weekly chunks. Data here will be displayed as daily averages and updates will be once per week (mondays?). In addition many of the data sources have stopped being published so many plots will no longer be change.

Trends

Hospitalisation as % of Peak Daily Averages as % of Peak Bi-weekly change Covid Variant Surviellance

Deaths

Deaths by Major Variant (Extrapolated from Surviellance)

Covid Variant Surviellance

COVID-19 Deaths

Thailand Covid Deaths by Reason

Thailand Covid Deaths by Region

Thailand Covid Deaths by Region

Deaths Top Provinces

Deaths Trending up Provinces

COVID-19 Deaths Age Range

Thailand Covid Death Age Range

Thailand Covid Death Age Range

COVID-19 Death Comorbidities and Risks

Thailand Covid Deaths Comorbidies

Thailand Covid Deaths Risk

Cases

Estimated Daily Infections

No longer updated so model is inaccurate

Cases by Region

Cases/100k by Region Bangkok Region - Central - Eastern - Western - Northeast A-N - Northeast N-Y - Northern C-N - Northern P-U - Southern C-P - Southern R-Y

Cases by Region

Cases by Province

Provinces with Most Cases

Provinces with Most Cases/100k

Trending Up Confirmed Cases (by Provinces)

Cases by Patient Type

Cases by Patient Type

Cases by Risk Classification

Cases by Risk

Trending Up Unknown Cases | Trending Up Contact Cases

Cases by Where Tested

Source of Confirmed Cases

Cases by Age

Ages of Confirmed cases

Cases and Social Distancing

Number of confirmed cases and reduced movement of people

Cases in Non-Thai

Cases by non-Thai nationality

Case Fatality Rate

Vaccinations

Vaccinations by Manufacturer

Manufacturer Vaccinations in Thailand

Vaccinations by Priority Groups

Daily Vaccinations in Thailand

Vaccinations in Thailand

Progress towards Full Vaccination

Progress towards booster Vaccination

Vaccinations by Region/Province

Vaccinated given by Region

Vaccinated given by Region

Daily Vaccinations

Vaccine Doses given by Region Vaccine Doses given by Region Vaccine Doses given by Region

By Province

Top Provinces by Vaccination 2nd Jab Lowest Provinces by Vaccination 2nd Jab

Top Provinces by Vaccination 3rd Jab

By Group

Vacccinated Over 60s - 2nd Dose - by Region

Vacccinated Risk of 7 Diseases - 2nd Dose - by Region

Active Cases/Hospitalisations

Thailand Active Cases

Thailand Cases in ICU

Testing

Positive Rate

Positive Rate

Positive Rate by Region - Thailand

Positive Rate by Health District - Thailand

PCR Tests in Thailand by day

Private and Public Tests

Private and Public Positive Results

PCR Tests by Health District

Tests by health District

Excess Deaths

Shows Deaths from all causes in comparison to the min, max and mean of Deaths from the 5 years pre-pandemic.

  • Note: there are many possible factors that alter deaths up or down other than uncounted Covid Deaths

Thailand Excess deaths with Covid Deaths

All Deaths compared to Previous Years

Thailand Excess Deaths by Age

All Deaths compared to Previous Years

Thailand Excess Deaths by Region

All Deaths compared to Previous Years

Thailand Deaths Years Compared

Testing, isolation and Vaccine assistance

How to contribute

Install

Running just plots (or latest files)

The plots are produced from csv files made in covid_data.py.

  1. Get the latest datasets release to speed up the process.

    • Manually: extract latest datasets into the top level of the project. It will put csv files into api and inputs/json folders.

    • CLI: linux(or WSL); change into the root directory of your clone of the repository and then:

      wget https://github.com/djay/covidthailand/releases/download/1/datasets.tar.gz && \
      tar xzf datasets.tar.gz && \
      rm datasets.tar.gz
  2. You can run only the plot function using the USE_CACHE_DATA=True MAX_DAYS=0 env vars

    • CLI (linux)
      USE_CACHE_DATA=True MAX_DAYS=0 bin/python covid_plot.py
    • IDE: setup a run profile in your IDE similar to this
        {
          "name": "covidthailand - plot",
          "type": "python",
          "request": "launch",
          "program": "covid_plot.py",
          "console": "integratedTerminal",
          "env": {
              "USE_CACHE_DATA":"True",
              "MAX_DAYS":"0",
          }
      }
  3. You can comment out parts of covid_plot.py to skip some plots.

    • In USE_CACHE_DATA only *_3.svg files are produced. 3 is for 3rd wave (since April 2021).

Running full code

  1. Extract the latest input files (~1.3G). This get the latest cache of documents to speed up scraping.

    • Manually: extract latest input files (~1.3G) into the top level of the project. It will put documents/json etc inputs/* folders.

    • CLI: linux(or WSL); change into the root directory of your clone of the repository and then:

      wget https://github.com/djay/covidthailand/releases/download/1/inputs.tar.gz && \
      tar xzf inputs.tar.gz && \
      rm inputs.tar.gz
    • Manually

  2. To build the CSV files needed for plotting from the inputs downloaded above, from the root directory of the repo, run:

    USE_CACHE_DATA=True python covid_data.py
  3. If many days have passed since the last run then return to step 1. or slightly slow but smaller download is to download the latest datasets files which will speed up dashboard scrapping which is the slowest part.

  4. If you really need to ensure all the files are scraped again then

Running Tests (scraping)

$ sudo gem update bundler
$ bundle config set --local path vendor/bundle
$ bundler install
$ bundle exec jekyll serve

Contributors

About

Made with python/pandas/matplotlib. Dylan Jay gave a talk on how easy it is to extract data from PDFs and powerpoints and plot data at Bangkok's Monthly ThaiPy Event Video: "How I scraped Thailand's covid data" (1h mark)

Why do this? Originally to answer the question "Was Thailand doing enough testing?" for myself and because too many people were wrong on the internets.

License

!Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Other sources of visualisations/Data for Thailand

Change log