Skip to main content

PyBMKG

Test CodeQL Docs codecov pre-commit security: bandit Checked with mypy Ruff pypi python License: MIT

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 asyncio and aiohttp for efficient API requests.
  • Data Schema: Built with Python's dataclass for clear and structured data representation.
  • Comprehensive Documentation: Explore detailed documentation for seamless integration and usage.

Installation

pip install PyBMKG

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

Docs

You can start reading the documentation here.

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.

Metadata

Release files for PyBMKG 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyBMKG 3.0.1
File Size Uploaded
pybmkg-3.0.1.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyBMKG 3.0.1
File Interpreter ABI Platform
pybmkg-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.8 kB

Release files / pybmkg-3.0.1.tar.gz

Download URL pybmkg-3.0.1.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bb27e3098917161bf0c4aeb19acb0144053b2714be32dfaa9dfa6e519b9dae31
BLAKE2b-256 checksum
How to use checksums
57358645bf509da1c669923e00d33ad3dfd2d939b33763a5d6bd293507332f6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via poetry/1.8.5 CPython/3.13.1 Linux/6.5.0-1025-azure

Release files / pybmkg-3.0.1-py3-none-any.whl

Download URL pybmkg-3.0.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c795fabf52c3412fabdc78982ce9b31f3194ae6f30448279a9043219c507f63a
BLAKE2b-256 checksum
How to use checksums
9183808e3bc7b9785caa39b1253114fa78c76be4c8da05031021e093cec06377
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via poetry/1.8.5 CPython/3.13.1 Linux/6.5.0-1025-azure

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

3.0.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page