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

Uploaded Source

Built Distribution

synopticpy-2024.12.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for synopticpy-2024.12.0.tar.gz
Algorithm Hash digest
SHA256 44ec3e84399510d9c10c50726a80e6b1829662837b4d6f412db0df74702d103a
MD5 1171c34845bb2e8d8644035cf391b6a5
BLAKE2b-256 ceb3ee533c6a7d76cde6bba4a8db4c1de26af1cbb2e47c4bb821c0963017f138

See more details on using hashes here.

Provenance

The following attestation bundles were made for synopticpy-2024.12.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-2024.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for synopticpy-2024.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa31c73424f5226f256da5e322ef33065f48f63534361c688dfa429173d0cc92
MD5 9db1b37ffd669b8db3be48c3b3e6f2d9
BLAKE2b-256 3ab029b8632539cf9e95f7e7da36fdf1cd99406d421bde0b022fb5371adbd818

See more details on using hashes here.

Provenance

The following attestation bundles were made for synopticpy-2024.12.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 AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page