Skip to main content

Unofficial BMKG API Python Wrapper.

Project description

bmkg

Unofficial Python wrapper for the BMKG (Meteorology, Climatology, and Geophysical Agency) API.

Installation

$ pip install bmkg

Importing

from bmkg import BMKG

Usage

P.S: wrap this example in an async function!

# initiate the class
bmkg = BMKG()

# 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


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.1.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page