PyBMKG
PyBMKG is an asynchronous Python API wrapper designed to harness the power of BMKG's open data on weather forecasts and earthquake information in Indonesia. Powered by the Meteorology, Climatology, and Geophysics Agency (BMKG), this project aims to streamline access to crucial meteorological and seismic data.
Key Features
- Asynchronous Operations: Utilizes
asyncioandaiohttpfor efficient API requests. - Data Schema: Built with Python's
dataclassfor clear and structured data representation. - Comprehensive Documentation: Explore detailed documentation for seamless integration and usage.
Installation
Usage
import asyncio
from bmkg import Earthquake, WeatherForecast
async def main():
async with Earthquake() as earthquake:
latest_earthquake = await earthquake.get_latest_earthquake()
strong_earthquake = await earthquake.get_strong_earthquake()
felt_earthquake = await earthquake.get_felt_earthquake()
print(f"Latest Earthquakes: {latest_earthquake}")
print(f"Strong Earthquakes: {strong_earthquake}")
print(f"Felt Earthquakes: {felt_earthquake}")
async with WeatherForecast() as weather_forecast:
weather_forecast = await weather_forecast.get_weather_forecast("11.01.01.2001")
print(f"Weather Forecast: {weather_forecast}")
asyncio.run(main())
Table Of Contents
You can start reading the documentation with the following links:
Contributing
We welcome contributions to enhance PyBMKG! Please review our contributing guidelines before getting started.
Acknowledgements
We would like to thank the Meteorology, Climatology and Geophysics Agency (BMKG) for its open data service on weather forecasts and latest earthquake information.