npm package: @ntlab/sipd-agr
Description: SIPD RI Kemendagri Automation is a web automation using Selenium to help manage data such as budgeting download
Author: Toha
Latest version: 3.11.0

# SIPD RI Kemendagri Automation

SIPD RI Kemendagri Automation is a web automation using [Selenium](https://selenium.dev) to help
manage data such as budgeting download. It provides functionality to download government budgeting
as Microsoft Excel worksheet as well as to download programs or accounts database.

Currently, supported features are:

* Download budgeting as Microsoft Excel worksheet
* Download programs as Microsoft Excel
* Download accounts as Microsoft Excel

## Installation

The app installation is described as follows:

* Install [Nodejs](https://nodejs.org)
* Get the app source code

  ```sh
  git clone https://github.com/tohenk/node-sipd-agr-bridge.git
  ```

* Install dependencies

  ```sh
  cd node-sipd-agr-bridge
  npm install
  ```

* To run the app, execute

  ```sh
  node main.js --help
  ```

  ```
  Usage:
  node main.js [options]

  Options:
  --config=filename, -c=filename                   Set configuration file
  --mode=mode                                      Processing mode, can be download or upload
  --url=url                                        Set SIPD url
  --username=username, -u=username                 Set username
  --password=password, -p=password                 Set password
  --year=year, -y=year                             Set year
  --dir=filename-or-folder, -d=filename-or-folder  Set input or output directory
  --no-download                                    Do not download from SIPD instead use previously downloaded files
  --help                                           Show program usage

  ```

## Configuration

Before you can use the app, you need to adjust its [/config/default.json](/config/default.json) configuration accordingly:

```json
{
    "url":"https://sipd-ri.kemendagri.go.id",
    "mode":"download",
    "provinsi":"CHANGEME",
    "username":"CHANGEME",
    "password":"CHANGEME",
    "year":"2025"
}
```

## Usage

### Download Budgeting as Microsoft Excel

Make sure `mode` set to `download` then run the app and pay attention if app needs to solve
the captcha.

```sh
node main.js
```

```
Reading configuration D:\Docs\Anggaran\sipd-agr\config.json
Using profile slow
Processing agr download, please wait...

DevTools listening on ws://127.0.0.1:58760/devtools/browser/3f701a9d-7fd2-4ad9-9512-c94792449a2d
Downloading list...
Downloading Penyusunan Dokumen Perencanaan Perangkat Daerah...
Downloading Koordinasi dan Penyusunan Dokumen RKA- SKPD...
Downloading Koordinasi dan Penyusunan Dokumen Perubahan RKA-SKPD...
Downloading Koordinasi dan Penyusunan DPA-SKPD...
Downloading Koordinasi dan Penyusunan Perubahan DPA- SKPD...
Downloading Koordinasi dan Penyusunan Laporan Capaian Kinerja dan Ikhtisar Realisasi Kinerja SKPD...
Downloading Evaluasi Kinerja Perangkat Daerah...
Downloading Penyediaan Gaji dan Tunjangan ASN...
Downloading Penyediaan Administrasi Pelaksanaan Tugas ASN...
Downloading Pelaksanaan Penatausahaan dan Pengujian/Verifikasi Keuangan SKPD...
Downloading Koordinasi dan Pelaksanaan Akuntansi SKPD...
Downloading Koordinasi dan Penyusunan Laporan Keuangan Akhir Tahun SKPD...
Downloading Pengelolaan dan Penyiapan Bahan Tanggapan Pemeriksaan...
Downloading Koordinasi dan Penyusunan Laporan Keuangan Bulanan/ Triwulanan/Semesteran SKPD...
Downloading Penyusunan Pelaporan dan Analisis Prognosis Realisasi Anggaran...
Downloading Peningkatan Sarana dan Prasarana Disiplin Pegawai...
Downloading Pendataan dan Pengolahan Administrasi Kepegawaian...
Downloading Koordinasi dan Pelaksanaan Sistem Informasi Kepegawaian...
Downloading Monitoring, Evaluasi, dan Penilaian Kinerja Pegawai...
Downloading Pendidikan dan Pelatihan Pegawai Berdasarkan Tugas dan Fungsi...
Downloading Penyediaan Komponen Instalasi Listrik/Penerangan Bangunan Kantor...
Downloading Penyediaan Peralatan dan Perlengkapan Kantor...
Downloading Penyediaan Bahan Logistik Kantor...
Downloading Penyediaan Barang Cetakan dan Penggandaan...
Downloading Penyediaan Bahan Bacaan dan Peraturan Perundang-Undangan...
Downloading Fasilitasi Kunjungan Tamu...
Downloading Penatausahaan Arsip Dinamis pada SKPD...
Downloading Dukungan Pelaksanaan Sistem Pemerintahan Berbasis Elektronik pada SKPD...
Downloading Pengadaan Sarana dan Prasarana Gedung Kantor atau Bangunan Lainnya...
Downloading Penyediaan Jasa Surat Menyurat...
Downloading Penyediaan Jasa Komunikasi, Sumber Daya Air dan Listrik...
Downloading Penyediaan Jasa Peralatan dan Perlengkapan Kantor...
Downloading Penyediaan Jasa Pelayanan Umum Kantor...
Downloading Penyediaan Jasa Pemeliharaan, Biaya Pemeliharaan dan Pajak Kendaraan Perorangan Dinas atau Kendaraan Dinas Jabatan...
Downloading Pemeliharaan Peralatan dan Mesin Lainnya...
Downloading Pemeliharaan/Rehabilitasi Gedung Kantor dan Bangunan Lainnya...
Downloading Pengelolaan Sarana dan Prasarana Spiritual...
Downloading Fasilitasi Kelembagaan Bina Spiritual...
Downloading Fasilitasi, Koordinasi, Sinkronisasi, Evaluasi dan Capaian Kinerja Kebijakan Kesejahteraan Rakyat Bidang Pendidikan...
Downloading Fasilitasi, Koordinasi dan Sinkronisasi, Evaluasi dan Capaian Kinerja Kebijakan Kesejahteraan Rakyat Bidang Kesehatan...
Downloading Fasilitasi, Koordinasi dan Sinkronisasi, Evaluasi dan Capaian Kinerja Kebijakan Kesejahteraan Rakyat Bidang Sosial...
Downloading Koordinasi dan Sinkronisasi Kebijakan Kesejahteraan Rakyat Bidang Kepemudaan, Olahraga, Kebudayaan, dan Pariwisata...
Downloading Koordinasi dan Sinkronisasi Kebijakan Kesejahteraan Rakyat Bidang Pemberdayaan Perempuan dan Perlindungan Anak, Pengendalian Penduduk dan Keluarga Berencana, Administrasi Kependudukan dan Pencatatan Sipil, Pemberdayaan Masyarakat dan Desa, Transmigrasi dan Tenaga Kerja...
Done importing 43 files...
Writing D:\Docs\Anggaran\sipd-agr\agr\401041030002.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401041030001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401041020003.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401041020002.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401041020001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401041010002.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401041010001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011090009.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011090006.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011090001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011080004.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011080003.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011080002.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011080001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011070010.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060011.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060010.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060008.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060006.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060005.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060004.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060002.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011060001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011050009.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011050005.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011050004.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011050003.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011050001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020008.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020007.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020006.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020005.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020004.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020003.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020002.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011020001.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011010007.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011010006.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011010005.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011010004.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011010003.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011010002.xlsx...
Writing D:\Docs\Anggaran\sipd-agr\agr\401011010001.xlsx...
Done
```

### Download Programs and Accounts as Microsoft Excel

Make sure `mode` set to `refs` then run the app and pay attention if app needs to solve
the captcha.

```sh
node main.js
```

```
Reading configuration D:\Docs\Anggaran\sipd-agr\config.json
Using profile slow
Processing references update, please wait...

DevTools listening on ws://127.0.0.1:58851/devtools/browser/4e4dd3d8-cff3-4b7d-8869-a66d014adb1b
Downloading file rek.json...
Downloading file keg.json...
Downloading file asb.json...
Downloading file hspk.json...
Downloading file sbu.json...
Downloading file ssh.json...
Creating ref D:\Docs\Anggaran\sipd-agr\refs\M_KODEREK.xlsx...
Creating ref D:\Docs\Anggaran\sipd-agr\refs\M_KEG.xlsx...
Done
```

## Summarize Downloaded Budgeting

There is a tool called [Agr](/tools/Agr.xlsm) which can be used to summarize downloaded budgeting
worksheets for easy reading. To do so, follow this steps:

1. Open the tool and make sure macro is enabled

    ![Enable macro](/assets/enable-macro.png)

2. Open budgeting file to be summarized

3. Run macro `AgrImport` to start summarize, you can run the macro by selecting `View > Macros > View Macros`
   then choose desired macro and hit `Run` button

    ![View macro](/assets/view-macro.png)
    ![Run macro](/assets/run-selected-macro.png)

4. Confirm `Yes` to start

    ![Confirm summarize](/assets/summarize-confirm.png)

5. Wait the app to do its job until it finished, a new workbook will be created as budgeting summary

    ![Summarize done](/assets/summarize-finish.png)

6. Repeat steps 2 to 5 for all budgeting files

7. Select the result workbook and run `AgrFormat` macro to do formatting

    ![Formatting result](/assets/formating-message.png)

8. The final step is to do real summarization, run `AgrSummarize` macro and wait until it finished

    ![Summarize result](/assets/summarize-result.png)