Unofficial BMKG API Python Wrapper.
Project description
bmkg
Unofficial Python wrapper for the BMKG (Meteorology, Climatology, and Geophysical Agency) API.
Installation
$ pip install bmkg
Usage
from bmkg import BMKG
# initiate the class
bmkg = BMKG()
# get indonesia's forecast
weather = await bmkg.get_forecast()
print(weather)
# get specific province's forecast
province_weather = await bmkg.get_forecast("aceh")
print(province_weather)
# get history of the latest earthquakes
earthquakes = await bmkg.get_recent_earthquakes()
for earthquake in earthquakes:
print(earthquake)
# get wind forecast image
image = await bmkg.get_wind_forecast()
with open("wind-forecast.jpg", "wb") as f:
f.write(image)
f.close()
# close the class once done
await bmkg.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bmkg-0.0.4.tar.gz
(7.1 kB
view hashes)