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

🎟️ You need a Synoptic API token before using SynopticPy. Register for a FREE Synoptic account now.

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

Uploaded Source

Built Distribution

synopticpy-2024.11.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: synopticpy-2024.11.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for synopticpy-2024.11.0.tar.gz
Algorithm Hash digest
SHA256 3d2eb315ada6a0d5894ab6e51129dccc826bb6aedad98a8fe38246adeb97873d
MD5 03b4fd041de348d7bac1d602718bdda1
BLAKE2b-256 712ca8d60b706320a800ac2b43613395d21a86b1ddf518e2dda61225ebacf324

See more details on using hashes here.

Provenance

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

Publisher: release_to_pypi.yml on blaylockbk/SynopticPy

Attestations:

File details

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

File metadata

File hashes

Hashes for synopticpy-2024.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15fc72e9b1f70c756c2aeaeb3eaedae1a4f30060a75bf6d292dc818ad81b277f
MD5 1875b6b4bea32c769ebdb93f3e318ee1
BLAKE2b-256 5cf75adbd45ab8c01ccfaac5e98cd61309e1ef61e7cc5462ca625d69485fd0e9

See more details on using hashes here.

Provenance

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

Publisher: release_to_pypi.yml on blaylockbk/SynopticPy

Attestations:

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