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 details)

Uploaded Source

File details

Details for the file bmkg-0.1.0.tar.gz.

File metadata

  • Download URL: bmkg-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for bmkg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 97f50a365a2cfa41cf4162e78f39fd2df7fc8f2eea6c158787eca73befda1301
MD5 e0b13bf432a5cac57c88fddd7e82e74a
BLAKE2b-256 fb55ba399e3cc054d6aa5c6d12b9baea92b3f4b39d3533137b3c1cc2d1d2cc45

See more details on using hashes here.

Supported by

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