Skip to main content

Retrieve mesonet weather data as Polars DataFrames from Synoptic's Weather API.

Project description

Shows a black logo in light color mode and a white one in dark color mode.

Synoptic API for Python

PyPI Conda Version DOI

License Ruff Tests (Python) Documentation Status Python Conda Recipe Conda Downloads

📘 Documentation | 💬 Discussions | 🚑 Issues

Synoptic's Weather API provides real-time and historical surface-based weather and environmental observations for thousands of mesonet stations, and the open-access data is free. More data and enhanced services may be purchased (from Synoptic, not me).

I'm a Synoptic user. I wrote this package to conveniently request data from Synoptic in a Pythonic way and convert its returned JSON to a Polars DataFrame.

from datetime import timedelta
from synoptic import TimeSeries

df = TimeSeries(
    stid="wbb",
    recent=timedelta(minutes=30)
).df()

alt text

I'm sharing this package to improve my skills with Polars and gain more experience in building and maintaining open-source Python packages. If you came across this package, I hope you find it valuable.

Best of Luck 🍀
-Brian

🐍 Install

pip install SynopticPy
conda install -c conda-forge synopticpy

Configure Token

[!IMPORTANT]

🎟️ To use SynopticPy you need a Synoptic API token.

There are three ways you can configure your Synoptic API token:

  1. Set an environment variable SYNOPTIC_TOKEN with your token. For example, in bash:
    export SYNOPTIC_TOKEN="yourTokenHere123456789"
    
  2. Create a file ~/.config/SynopticPy/config.toml with the following
    token = "yourTokenHere123456789"
    
  3. Pass your token whenever you use one of SynopticPy's classes.
    TimeSeries(
        stid="wbb",
        recent=30,
        token="yourTokenHere123456789"
    )
    

How to Cite and Acknowledge

If SynopticPy played an important role in your work, please tell me about it! Also, consider including a citation or acknowledgement in your article or product.

Suggested Citation

Blaylock, B. K. (YEAR). SynopticPy: Synoptic API for Python (Version 20??.?.?) [Computer software]. https://github.com/blaylockbk/SynopticPy

Suggested Acknowledgment

A portion of this work used code generously provided by Brian Blaylock's SynopticPy Python package (https://github.com/blaylockbk/SynopticPy)



[!TIP]

📈 See also my SynopticPy Web App which lets you plot station data in your browser powered by pyscript!

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

synopticpy-2025.9.0.tar.gz (161.9 kB view details)

Uploaded Source

Built Distribution

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

synopticpy-2025.9.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file synopticpy-2025.9.0.tar.gz.

File metadata

  • Download URL: synopticpy-2025.9.0.tar.gz
  • Upload date:
  • Size: 161.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for synopticpy-2025.9.0.tar.gz
Algorithm Hash digest
SHA256 29131d23cc30cd24a56292a63784b4c390eea337a667e0738fb413cae0a7e32d
MD5 128268a0a7323395eaddf134198329a5
BLAKE2b-256 98caaba47ad3683d29f43d3be6f83d275af6459a7933c4ab8323cdd64ca59d65

See more details on using hashes here.

Provenance

The following attestation bundles were made for synopticpy-2025.9.0.tar.gz:

Publisher: release_to_pypi.yml on blaylockbk/SynopticPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synopticpy-2025.9.0-py3-none-any.whl.

File metadata

  • Download URL: synopticpy-2025.9.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for synopticpy-2025.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0b1cc0ba9e26b0f76c89dce54113d71e18fbf1d7ea0cfc013a4c09bb403fed
MD5 d9c63fab2f7e5a7ff6643ff43c642c33
BLAKE2b-256 8c97ad0664d48091d4fd078327e2d3a31ce0a66375f7ff44c9a949e231def960

See more details on using hashes here.

Provenance

The following attestation bundles were made for synopticpy-2025.9.0-py3-none-any.whl:

Publisher: release_to_pypi.yml on blaylockbk/SynopticPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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