Skip to content

RomySaputraSihananda/craw-DataPrakiraanCuaca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter: romy

craw-DataPrakiraanCuaca

Program ini dirancang melakukan crawling data prakiraan cuaca dari BMKG. Aplikasi ini memanfaatkan
modul xmltodict untuk mengolah data XML menjadi dictionary dan requests untuk mengambil data
dari layanan prakiraan cuaca. Tujuan utama dari program ini adalah untuk mengumpulkan informasi
cuaca terkini dari BMKG sesuai dengan provinsi yang diinputkan oleh pengguna.

Requirements

  • Python >= 3.11.4
  • Requests >= 2.31.0
  • xmltodict >= 0.12.0

Installation

# Clonig Repository
git clone https://github.com/romysaputrasihananda/craw-DataPrakiraanCuaca

# Change Directory
cd craw-DataPrakiraanCuaca

# Install Requirement
pip install -r requirements.txt

Example Usages

python main.py --provinsi=DKIJakarta --output=data

Flags

Flag Alias Description Example Default
--provinsi -p name of the province --provinsi=DKIJakarta DKIJakarta
--output -o json file output path --output=data data

Sample Output

{
  "timestamp": "2023-12-13T03:42:54",
  "source": "meteofactory",
  "productioncenter": "NC Jakarta",
  "data": [
    {
      "kabupaten": {
        "en_US": "Jakarta Barat",
        "id_ID": "Kota Jakarta Barat"
      },
      "provinsi": "DKI Jakarta",
      "coordinate": "106.731319 -6.203019",
      "parameter": {
        "kelembapan_udara": {
          "type": "hourly",
          "timerange": [
            {
              "datetime": "2023-12-13T00:00:00",
              "value": {
                "%": 80.0
              }
            }
            // more time
          ]
        },
        "kelembapan_udara_maksimum": {
          "type": "daily",
          "timerange": [
            {
              "datetime": "2023-12-13T12:00:00",
              "value": {
                "%": 80.0
              }
            }
            // more time
          ]
        },
        "suhu_udara_maksimum": {
          "type": "daily",
          "timerange": [
            {
              "datetime": "2023-12-13T12:00:00",
              "value": {
                "C": 31.0,
                "F": 87.8
              }
            }
            // more time
          ]
        },
        "kelembapan_udara_minimum": {
          "type": "daily",
          "timerange": [
            {
              "datetime": "2023-12-13T12:00:00",
              "value": {
                "%": 65.0
              }
            }
            // more time
          ]
        },
        "suhu_udara_minimum": {
          "type": "daily",
          "timerange": [
            {
              "datetime": "2023-12-13T12:00:00",
              "value": {
                "C": 23.0,
                "F": 73.4
              }
            }
            // more time
          ]
        },
        "suhu_udara": {
          "type": "hourly",
          "timerange": [
            {
              "datetime": "2023-12-13T00:00:00",
              "value": {
                "C": 25.0,
                "F": 77.0
              }
            }
            // more time
          ]
        },
        "cuaca": {
          "type": "hourly",
          "timerange": [
            {
              "datetime": "2023-12-13T00:00:00",
              "value": "Cerah Berawan / Partly Cloudy"
            }
            // more time
          ]
        },
        "arah_angin": {
          "type": "hourly",
          "timerange": [
            {
              "datetime": "2023-12-13T00:00:00",
              "value": {
                "deg": 247.5,
                "CARD": "West-Southwest",
                "SEXA": 24730.0
              }
            }
            // more time
          ]
        },
        "kecepatan_angin": {
          "type": "hourly",
          "timerange": [
            {
              "datetime": "2023-12-13T00:00:00",
              "value": {
                "Kt": 2.0,
                "MPH": 2.3015589,
                "KPH": 3.704,
                "MS": 1.028888888
              }
            }
            // more time
          ]
        }
      }
    }
    // more kabupaten
  ]
}

License

This project is licensed under the MIT License.

About

crawling and scrapping weather data from BMKG website

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages