Python module for getting data from covid19.go.id
Project description
covid19-id
Python module for getting data from covid19.go.id
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 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-0.4.1.tar.gz
(7.1 kB
view hashes)
Built Distribution
covid19_id-0.4.1-py3-none-any.whl
(13.0 kB
view hashes)
Close
Hashes for covid19_id-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aa41ddbd19c41f1d5a1a3391e2bb0bb92ab9891ad165f808f735121a1143b79 |
|
MD5 | 8592d6fc4c14bd2eb9826c742ab6386c |
|
BLAKE2b-256 | 60316a14bd69cc211850b8a54698f0195b65d621c16c357876f3c64fd10c0bf5 |