Skip to content

Commit dc8cf6d

Browse files
committed
Add README.id.md
1 parent f891b52 commit dc8cf6d

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

README.id.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# covid19-id
2+
3+
[![covid19-id - PyPi](https://img.shields.io/pypi/v/covid19-id)](https://pypi.org/project/covid19-id/)
4+
[![Supported Python versions](https://img.shields.io/pypi/pyversions/covid19-id)](https://pypi.org/project/covid19-id/)
5+
[![LICENSE](https://img.shields.io/github/license/hexatester/covid19-id)](https://github.com/hexatester/covid19-id/blob/main/LICENSE)
6+
[![codecov](https://codecov.io/gh/hexatester/covid19-id/branch/main/graph/badge.svg)](https://codecov.io/gh/hexatester/covid19-id)
7+
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
8+
[![Mypy](https://img.shields.io/badge/Mypy-enabled-brightgreen)](https://github.com/python/mypy)
9+
10+
Modul python untuk mengambil data dari covid19.go.id
11+
12+
## Install
13+
14+
Anda dapat menginstall atau mengupdate covid19-id dengan perintah:
15+
16+
```bash
17+
pip install covid19-id --upgrade
18+
```
19+
20+
## Dependensi Tambahn
21+
22+
covid19-id dapat diinstall dengan modul tambahan [ujson](https://pypi.org/project/ujson/ "ujson - PyPi").
23+
24+
```bash
25+
pip install covid19-id[ujson]
26+
```
27+
28+
Modul `ujson` tersebut akan digunakan untuk mendekode JSON, yang lebih cepat dibandingkan dengan standard [json](https://docs.python.org/3/library/json.html "python json docs") modul.
29+
30+
## Contoh
31+
32+
### Mendapat Pembaruan
33+
34+
```python
35+
import covid19_id
36+
37+
all_update = covid19_id.get_update()
38+
39+
total = all_update.update.total
40+
41+
print(f"covid19; kasus positif di Indonesia : {total.jumlah_positif}")
42+
print(f"covid19; pasien dirawat di Indonesia {total.jumlah_dirawat}")
43+
print(f"covid19; pasien sembuh di Indonesia {total.jumlah_sembuh}")
44+
print(f"covid19; pasien meninggal Indonesia {total.jumlah_meninggal}")
45+
46+
```
47+
48+
### Data Provinsi
49+
50+
```python
51+
import covid19_id
52+
53+
data_provinsi = covid19_id.get_prov()
54+
55+
for provinsi in data_provinsi.list_data:
56+
print(f"Nama Provinsi : {provinsi.key}")
57+
print(f"Jumlah Kasus {provinsi.jumlah_kasus}")
58+
print(f"Jumlah Sembuh {provinsi.jumlah_sembuh}")
59+
print(f"Jumlah Meninggal {provinsi.jumlah_meninggal}")
60+
for umur in provinsi.kelompok_umur:
61+
print(f"Umur {umur.key} : {umur.doc_count}")
62+
penambahan = provinsi.penambahan
63+
print(f"Kasus Positif tambahan {penambahan.positif}")
64+
print(f"Tambahan sembuh {penambahan.sembuh}")
65+
print(f"Tambahan meninggal {penambahan.meninggal}")
66+
print("")
67+
68+
```
69+
70+
### Pemeriksaan dan Vaksinasi
71+
72+
```python
73+
import covid19_id
74+
75+
76+
pemeriksaan_vaksinasi = covid19_id.get_pemeriksaan_vaksinasi()
77+
78+
vaksinasi_total = pemeriksaan_vaksinasi.vaksinasi.total
79+
80+
print(f"Jumlah vaksinasi pertama {vaksinasi_total.jumlah_vaksinasi_1}")
81+
print(f"Jumlah vaksinasi kedua {vaksinasi_total.jumlah_vaksinasi_2}")
82+
83+
```

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
[![Mypy](https://img.shields.io/badge/Mypy-enabled-brightgreen)](https://github.com/python/mypy)
99

1010
Python module for getting data from covid19.go.id
11-
Modul python untuk mengambil data dari covid19.go.id
11+
12+
[Readme Bahasa Indonesia](README.id.md)
1213

1314
## Install
1415

0 commit comments

Comments
 (0)