Skip to main content

SuperMAG Python Client

The SuperMAG Python Client provides programmatic access to magnetometer data and indices from the SuperMAG web services API. It supports data retrieval, station inventory queries, and data manipulation using Python with built-in pandas support.

Features

  • Inventory Query: Retrieve lists of SuperMAG stations for a given event.
  • Magnetometer Data: Fetch vector magnetic field data (NEZ, geographic) for selected stations.
  • Magnetic Indices: Retrieve SuperMAG indices (SME, SMU, SML, etc.) with support for sunlit/dark/regional variations and solar wind parameters.
  • Flexible Output: Choose between pandas.DataFrame or raw list outputs via FORMAT parameter.
  • Helper Tools: Utility functions to extract nested dictionary structures, process CSV exports, and perform unit tests.

Requirements

  • Python 3
  • pandas (pip install pandas)
  • certifi (required at sites with SSL cert enforcement)

Example Usage

from supermag_api import *
userid = 'YOUR_SUPERMAG_USER_ID'
start = [2019, 11, 15, 10, 40]

# Get inventory
status, stations = SuperMAGGetInventory(userid, start, 3600)

# Fetch data
status, data = SuperMAGGetData(userid, start, 3600, 'all', 'HBK')

# Fetch indices
status, indices = SuperMAGGetIndices(userid, start, 3600, 'all')

# Access nested components
n_nez = sm_grabme(data, 'N', 'nez')

# Quick test
sm_microtest(4, userid)

Metadata

Release files for supermag-api 0.0.6

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

Source distribution (sdist)

Source distribution for supermag-api 0.0.6
File Size Uploaded
supermag_api-0.0.6.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for supermag-api 0.0.6
File Interpreter ABI Platform
supermag_api-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / supermag_api-0.0.6.tar.gz

Download URL supermag_api-0.0.6.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e17818ed18ca310bab65cc741c7182d22b44f578fe5f8f174d73595c5f28da29
BLAKE2b-256 checksum
How to use checksums
c3b7591b2ae3dd652b75933ab1c9abaa3bbe8ae94346e25d6234cf28fbb426a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / supermag_api-0.0.6-py3-none-any.whl

Download URL supermag_api-0.0.6-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b0df0f2c7d1dc22fc256b5c7da6d79f596c4c4c95aba9a3cedc1d5153b47688
BLAKE2b-256 checksum
How to use checksums
8e4d0e22e260671910980acdf925fb40735a27c6ffbecf311fc924a4c6ce6c02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

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