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()
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
pip install SynopticPy
conda install -c conda-forge synopticpy
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:
- Set an environment variable
SYNOPTIC_TOKEN
with your token. For example, in bash:export SYNOPTIC_TOKEN="yourTokenHere123456789"
- Create a file
~/.config/SynopticPy/config.toml
with the followingtoken = "yourTokenHere123456789"
- Pass your token whenever you use one of SynopticPy's classes.
TimeSeries( stid="wbb", recent=30, token="yourTokenHere123456789" )
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