Skip to main content

Python module for getting data from covid19.go.id

Project description

covid19-id

covid19-id - PyPi Supported Python versions LICENSE codecov pre-commit Mypy

Python module for getting data from Indonesian government (covid19.go.id)

Readme Bahasa Indonesia

Install

You can install or upgrade covid19-id with:

pip install covid19-id --upgrade

Optional Dependencies

covid19-id can be installed with optional ujson dependency.

pip install covid19-id[ujson]

It will then be used for JSON decoding, which can bring speed up compared to the standard json library.

Example

Get Data

import covid19_id

data = covid19_id.get_data()

print("View symptom data")
print(f"Recorded data {100-data.kasus.gejala.missing_data:.2f}%")
print(f"Unrecorded data {data.kasus.gejala.missing_data:.2f}%")

for gejala in data.kasus.gejala.list_data:
    print(f"{gejala.doc_count:.2f}% with symptoms {gejala.key.capitalize()}")

Get Updates

import covid19_id

all_update = covid19_id.get_update()

total = all_update.update.total

print(f"covid19; positive cases in Indonesia : {total.jumlah_positif}")
print(f"covid19; patients treated in Indonesia {total.jumlah_dirawat}")
print(f"covid19; patients recovered in Indonesia {total.jumlah_sembuh}")
print(f"covid19; patients died in Indonesia {total.jumlah_meninggal}")

Provinsi

import covid19_id

data_provinsi = covid19_id.get_prov()

for provinsi in data_provinsi.list_data:
    print(f"Province : {provinsi.key}")
    print(f"Cases {provinsi.jumlah_kasus}")
    print(f"Recovered {provinsi.jumlah_sembuh}")
    print(f"Died {provinsi.jumlah_meninggal}")
    for umur in provinsi.kelompok_umur:
        print(f"Age {umur.key} : {umur.doc_count}")
    penambahan = provinsi.penambahan
    print(f"Additional Positive Cases {penambahan.positif}")
    print(f"Additional Recovered {penambahan.sembuh}")
    print(f"Additional Died {penambahan.meninggal}")
    print("")

Vaccinated

import covid19_id


pemeriksaan_vaksinasi = covid19_id.get_pemeriksaan_vaksinasi()

vaksinasi_total = pemeriksaan_vaksinasi.vaksinasi.total

print(f"vaccinated population (first one) {vaksinasi_total.jumlah_vaksinasi_1}")
print(f"vaccinated population (second time) {vaksinasi_total.jumlah_vaksinasi_2}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covid19-id-1.0.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

covid19_id-1.0.1-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file covid19-id-1.0.1.tar.gz.

File metadata

  • Download URL: covid19-id-1.0.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.7.10 Linux/5.4.0-1047-azure

File hashes

Hashes for covid19-id-1.0.1.tar.gz
Algorithm Hash digest
SHA256 118d2709443e824edb649eead836a8570ed136f62d0294f32aa070fe9ec6122c
MD5 93eae594c9c6d796bbc85a5ce4775f32
BLAKE2b-256 4cb011ebf2dc93b5ae7182cc9a7562dd4373c51a7fccf8c08b4b7e6ee01c3fd6

See more details on using hashes here.

File details

Details for the file covid19_id-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: covid19_id-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.7.10 Linux/5.4.0-1047-azure

File hashes

Hashes for covid19_id-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ac2302e4294834e3f3b46d6a8671b57886a52d9cbabf271e1b05ee0bd1cc9a3
MD5 f720ddfd06a90344440d849fc8862bc1
BLAKE2b-256 291d56a560d05e032519069a452fa031602cebed029db0335321a6c8a2216ac8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page