Retrieve mesonet weather data as Polars DataFrames from Synoptic's Weather API.
Project description
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()
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:
- 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" )
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d2eb315ada6a0d5894ab6e51129dccc826bb6aedad98a8fe38246adeb97873d |
|
MD5 | 03b4fd041de348d7bac1d602718bdda1 |
|
BLAKE2b-256 | 712ca8d60b706320a800ac2b43613395d21a86b1ddf518e2dda61225ebacf324 |
Provenance
The following attestation bundles were made for synopticpy-2024.11.0.tar.gz
:
Publisher:
release_to_pypi.yml
on blaylockbk/SynopticPy
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
synopticpy-2024.11.0.tar.gz
- Subject digest:
3d2eb315ada6a0d5894ab6e51129dccc826bb6aedad98a8fe38246adeb97873d
- Sigstore transparency entry: 148242633
- Sigstore integration time:
- Predicate type:
File details
Details for the file synopticpy-2024.11.0-py3-none-any.whl
.
File metadata
- Download URL: synopticpy-2024.11.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15fc72e9b1f70c756c2aeaeb3eaedae1a4f30060a75bf6d292dc818ad81b277f |
|
MD5 | 1875b6b4bea32c769ebdb93f3e318ee1 |
|
BLAKE2b-256 | 5cf75adbd45ab8c01ccfaac5e98cd61309e1ef61e7cc5462ca625d69485fd0e9 |
Provenance
The following attestation bundles were made for synopticpy-2024.11.0-py3-none-any.whl
:
Publisher:
release_to_pypi.yml
on blaylockbk/SynopticPy
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
synopticpy-2024.11.0-py3-none-any.whl
- Subject digest:
15fc72e9b1f70c756c2aeaeb3eaedae1a4f30060a75bf6d292dc818ad81b277f
- Sigstore transparency entry: 148242634
- Sigstore integration time:
- Predicate type: