Skip to main content

GFZ Helmholtz Centre for Geosciences Web Service API Client

Description

Unofficial client for Helmholtz Centre for Geosciences Web Service API. For getting Geomagnetic Index (Kp, etc) Nowcast and Forecast data (https://spaceweather.gfz-potsdam.de/products-data/forecasts/forecast-kp-index). Kp is an important measure for the energy input from the solar wind to Earth and it is used by space weather services in near real-time. The geomagnetic Hpo index is a Kp-like index with a time resolution of half an hour, called Hp30, and one hour, called Hp60.

Official API description : https://kp.gfz-potsdam.de/en/data

Python 3.10+ requires

Features

  • Getting geomagnetic index forecast (as a Dict)
  • Getting geomagnetic three-hourly index for period (as a Dict)
  • Getting geomagnetic three-hourly index for period as a Tuple (like an official client by GFZ German Research Centre for Geosciences)

Classes

Library provides Classic and Asynchronous client classes for using in python applications:

GFZClient - Classic client class for Web Service API

GFZAsyncClient - Asynchronous client class for Web Service API

Methods

get_forecast(index)

Returns Dict with Index prediction dataset. Parameter index define index for data request. Should be in ('Kp','Hp30', 'Hp30')

get_nowcast(start_time, end_time, index, [data_state])

Returns Dict with geomagnetic three-hourly Index for period. Parameters start_time and end_time defines time period. Both should be string with UTC date/time, format: 'YYYY-MM-DD' or 'YYYY-MM-DDThh:mm:ss' Parameter index define index for data request. Should be in ('Kp', 'ap', 'Ap', 'Cp', 'C9', 'Hp30', 'Hp60', 'ap30', 'ap60', 'SN', 'Fobs', 'Fadj') Optional Parameter data_state define index state. Possible values: 'def', 'all'. Output of definitive values only (only for Kp, ap, Ap, Cp, C9, SN)

get_kp_index(starttime, endtime, index, [status])

Returns tuple with geomagnetic three-hourly Index for period or (0, 0, 0) in an Error case. Parameters starttime and endtime defines time period. Both should be string with UTC date/time, format: 'YYYY-MM-DD' or 'YYYY-MM-DDThh:mm:ss' Parameter index define index for data request. Should be in ('Kp', 'ap', 'Ap', 'Cp', 'C9', 'Hp30', 'Hp60', 'ap30', 'ap60', 'SN', 'Fobs', 'Fadj') Optional Parameter status define index state. Possible values: 'def', 'all'. Output of definitive values only (only for Kp, ap, Ap, Cp, C9, SN)

Method get_kp_index implements getKpindex method from official python client with same behaviour and added for compatibility purposes

How to use

Installation

pip install gfz-api-client

Classic client

from gfz_client import GFZClient

client = GFZClient()

# Get geomagnetic index forecast
data = client.get_forecast(index="Kp")

# Get geomagnetic three-hourly Kp index for period
data = client.get_nowcast(start_time="2011-11-04T00:05:23", end_time="2011-11-04T00:05:23", index="Kp")

# Get geomagnetic three-hourly Kp index for period as a tuple
data = client.get_kp_index(starttime="2011-11-04T00:05:23Z", endtime="2011-11-04T00:05:23Z", index="Kp")

Asynchronous client

from gfz_client import GFZAsyncClient

client = GFZAsyncClient()

# Get geomagnetic index forecast
data = await client.get_forecast(index="Kp")

# Get geomagnetic three-hourly Kp index for period
data = await client.get_nowcast(start_time="2011-11-04T00:05:23Z", end_time="2011-11-04T00:05:23Z", index="Kp")

# Get geomagnetic three-hourly Kp index for period as a tuple
data = await client.get_kp_index(starttime="2011-11-04T00:05:23", endtime="2011-11-04T00:05:23", index="Kp")

Metadata

Release files for gfz-api-client 0.1.0

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

Source distribution (sdist)

Source distribution for gfz-api-client 0.1.0
File Size Uploaded Provenance Actions
gfz_api_client-0.1.0.tar.gz 8.2 kB Without provenance Details for gfz_api_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gfz-api-client 0.1.0
File Interpreter ABI Platform Actions
gfz_api_client-0.1.0-py3-none-any.whl Python 3 none any Details for gfz_api_client-0.1.0-py3-none-any.whl

Total release size: 18.3 kB

Release files / gfz_api_client-0.1.0.tar.gz

Download URL gfz_api_client-0.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
55828faad1d89f3af0a9924bcdc19de190c4e9cdeaee7cfb685ad4fda445371b
BLAKE2b-256 checksum
How to use checksums
55acfb7efe65db404c7fa27f7b6e17c375b785f6136ff86d61609c6239587c2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release files / gfz_api_client-0.1.0-py3-none-any.whl

Download URL gfz_api_client-0.1.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b591461d03e148269a52c4b48c6b211e2e573f67eac10fd6817209ab2cf8868
BLAKE2b-256 checksum
How to use checksums
2c55fd36b12d0692f8fa8835e439acc961ca3e90ec0c233fb783582f2ff2b575
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Security for gfz-api-client 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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