Skip to main content

Python BMKG API Wrapper

Project description

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 BMKG
from bmkg.enums import Province

async def main():
    async with BMKG() as bmkg:
        weather_forecast = await bmkg.weather_forecast.get_weather_forecast(Province.ACEH)
        latest_earthquake = await bmkg.earthquake.get_latest_earthquake()
        strong_earthquake = await bmkg.earthquake.get_strong_earthquake()
        felt_earthquake = await bmkg.earthquake.get_felt_earthquake()

        print(f"Weather Forecast: {weather_forecast}")
        print(f"Latest Earthquakes: {latest_earthquake}")
        print(f"Strong Earthquakes: {strong_earthquake}")
        print(f"Felt Earthquakes: {felt_earthquake}")

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.

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

pybmkg-2.1.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

pybmkg-2.1.0-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file pybmkg-2.1.0.tar.gz.

File metadata

  • Download URL: pybmkg-2.1.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1023-azure

File hashes

Hashes for pybmkg-2.1.0.tar.gz
Algorithm Hash digest
SHA256 baf66967b40c6a696b997c2fe065b26b6e57d29aff17dae45ba43b6011082241
MD5 b2fdeb446e4432182eea1da63df30c8c
BLAKE2b-256 901ff70a8e9d7e0ecd6c42f4f8a04f8fac7bb8c2bf40c67a5735f1778cb46bfe

See more details on using hashes here.

File details

Details for the file pybmkg-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: pybmkg-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1023-azure

File hashes

Hashes for pybmkg-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb25338042a5938aec2260cef7ac8f7c9947af99309c047c4c0e97eace56b18b
MD5 72a68574e7fb97a5305310ad4a2793ed
BLAKE2b-256 4b44ea9f303d86205f5c52e67ae24ff3e60390fe465e3d6ce1c40ed23e04feee

See more details on using hashes here.

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