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 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.

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-3.0.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybmkg-3.0.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pybmkg-3.0.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: poetry/1.8.5 CPython/3.13.1 Linux/6.5.0-1025-azure

File hashes

Hashes for pybmkg-3.0.1.tar.gz
Algorithm Hash digest
SHA256 bb27e3098917161bf0c4aeb19acb0144053b2714be32dfaa9dfa6e519b9dae31
MD5 9213396493b782d9c27ed6d93c2b2a4c
BLAKE2b-256 57358645bf509da1c669923e00d33ad3dfd2d939b33763a5d6bd293507332f6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pybmkg-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: poetry/1.8.5 CPython/3.13.1 Linux/6.5.0-1025-azure

File hashes

Hashes for pybmkg-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c795fabf52c3412fabdc78982ce9b31f3194ae6f30448279a9043219c507f63a
MD5 f3828ee857b7f4def7281eb900eb8a51
BLAKE2b-256 9183808e3bc7b9785caa39b1253114fa78c76be4c8da05031021e093cec06377

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