Name | SynopticPy JSON |
Version |
2024.12.0
JSON |
| download |
home_page | None |
Summary | Retrieve mesonet weather data as Polars DataFrames from Synoptic's Weather API. |
upload_time | 2024-12-05 05:51:29 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | MIT License Copyright (c) 2019-2024 Brian Blaylock Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
atmosphere
mesonet
meteorology
weather
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div
align='center'
>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/blaylockbk/SynopticPy/refs/heads/56-rewrite-using-polars/docs/_static/SynopticPy_white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/blaylockbk/SynopticPy/refs/heads/56-rewrite-using-polars/docs/_static/SynopticPy_blue.svg">
<img alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://raw.githubusercontent.com/blaylockbk/SynopticPy/refs/heads/56-rewrite-using-polars/docs/_static/SynopticPy_blue.svg" width=300>
</picture>
## Synoptic API for Python
<!-- Badges -->
[![PyPI](https://img.shields.io/pypi/v/SynopticPy)](https://pypi.python.org/pypi/SynopticPy/)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/synopticpy.svg)](https://anaconda.org/conda-forge/synopticpy)
[![DOI](https://zenodo.org/badge/288617886.svg)](https://zenodo.org/badge/latestdoi/288617886)
![License](https://img.shields.io/github/license/blaylockbk/SynopticPy)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Tests (Python)](https://github.com/blaylockbk/SynopticPy/actions/workflows/tests-python.yml/badge.svg)](https://github.com/blaylockbk/SynopticPy/actions/workflows/tests-python.yml)
[![Documentation Status](https://readthedocs.org/projects/synopticpy/badge/?version=latest)](https://synopticpy.readthedocs.io/?badge=latest)
[![Python](https://img.shields.io/pypi/pyversions/SynopticPy.svg)](https://pypi.org/project/SynopticPy/)
[![Conda Recipe](https://img.shields.io/badge/recipe-synopticpy-green.svg)](https://anaconda.org/conda-forge/synopticpy)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/synopticpy.svg)](https://anaconda.org/conda-forge/synopticpy)
<!-- (Badges) -->
## 📘 [Documentation](https://synopticpy.readthedocs.io/) | [💬 Discussions](https://github.com/blaylockbk/SynopticPy/discussions) | [🚑 Issues](https://github.com/blaylockbk/SynopticPy/issues)
</div>
[Synoptic's Weather API](https://synopticdata.com/weatherapi/) provides real-time and historical surface-based weather and environmental observations for thousands of mesonet stations, and the [open-access data](https://synopticdata.com/pricing/open-access-pricing/) 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](https://docs.pola.rs/user-guide/getting-started/)**.
```python
from datetime import timedelta
from synoptic import TimeSeries
df = TimeSeries(
stid="wbb",
recent=timedelta(minutes=30)
).df()
```
![alt text](docs/_static/json_to_polars.png)
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
```bash
pip install SynopticPy
```
```bash
conda install -c conda-forge synopticpy
```
## Configure Token
> [!IMPORTANT]
>
> ## 🎟️ To use SynopticPy you need a [Synoptic API token](https://customer.synopticdata.com/).
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:
```bash
export SYNOPTIC_TOKEN="yourTokenHere123456789"
```
1. Create a file `~/.config/SynopticPy/config.toml` with the following
```toml
token = "yourTokenHere123456789"
```
1. Pass your token whenever you use one of SynopticPy's classes.
```python
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](https://github.com/blaylockbk/SynopticPY/discussions/categories/show-and-tell)! 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)
<br>
<hr>
> [!TIP]
>
> ### 📈 See also my [SynopticPy Web App](https://blaylockbk.github.io/SynopticPy) which lets you plot station data in your browser powered by [pyscript](https://pyscript.net/)!
Raw data
{
"_id": null,
"home_page": null,
"name": "SynopticPy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "\"Brian K. Blaylock\" <blaylockbk@gmail.com>",
"keywords": "atmosphere, mesonet, meteorology, weather",
"author": null,
"author_email": "\"Brian K. Blaylock\" <blaylockbk@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ce/b3/ee533c6a7d76cde6bba4a8db4c1de26af1cbb2e47c4bb821c0963017f138/synopticpy-2024.12.0.tar.gz",
"platform": null,
"description": "<div\n align='center'\n>\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/blaylockbk/SynopticPy/refs/heads/56-rewrite-using-polars/docs/_static/SynopticPy_white.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/blaylockbk/SynopticPy/refs/heads/56-rewrite-using-polars/docs/_static/SynopticPy_blue.svg\">\n <img alt=\"Shows a black logo in light color mode and a white one in dark color mode.\" src=\"https://raw.githubusercontent.com/blaylockbk/SynopticPy/refs/heads/56-rewrite-using-polars/docs/_static/SynopticPy_blue.svg\" width=300>\n</picture>\n\n## Synoptic API for Python\n\n<!-- Badges -->\n\n[![PyPI](https://img.shields.io/pypi/v/SynopticPy)](https://pypi.python.org/pypi/SynopticPy/)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/synopticpy.svg)](https://anaconda.org/conda-forge/synopticpy)\n[![DOI](https://zenodo.org/badge/288617886.svg)](https://zenodo.org/badge/latestdoi/288617886)\n\n![License](https://img.shields.io/github/license/blaylockbk/SynopticPy)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Tests (Python)](https://github.com/blaylockbk/SynopticPy/actions/workflows/tests-python.yml/badge.svg)](https://github.com/blaylockbk/SynopticPy/actions/workflows/tests-python.yml)\n[![Documentation Status](https://readthedocs.org/projects/synopticpy/badge/?version=latest)](https://synopticpy.readthedocs.io/?badge=latest)\n[![Python](https://img.shields.io/pypi/pyversions/SynopticPy.svg)](https://pypi.org/project/SynopticPy/)\n[![Conda Recipe](https://img.shields.io/badge/recipe-synopticpy-green.svg)](https://anaconda.org/conda-forge/synopticpy)\n[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/synopticpy.svg)](https://anaconda.org/conda-forge/synopticpy)\n\n<!-- (Badges) -->\n\n## \ud83d\udcd8 [Documentation](https://synopticpy.readthedocs.io/) | [\ud83d\udcac Discussions](https://github.com/blaylockbk/SynopticPy/discussions) | [\ud83d\ude91 Issues](https://github.com/blaylockbk/SynopticPy/issues)\n\n</div>\n\n[Synoptic's Weather API](https://synopticdata.com/weatherapi/) provides real-time and historical surface-based weather and environmental observations for thousands of mesonet stations, and the [open-access data](https://synopticdata.com/pricing/open-access-pricing/) is _free_. More data and enhanced services may be purchased (from Synoptic, not me).\n\nI'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](https://docs.pola.rs/user-guide/getting-started/)**.\n\n```python\nfrom datetime import timedelta\nfrom synoptic import TimeSeries\n\ndf = TimeSeries(\n stid=\"wbb\",\n recent=timedelta(minutes=30)\n).df()\n```\n\n![alt text](docs/_static/json_to_polars.png)\n\nI'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.\n\n**Best of Luck \ud83c\udf40** \n-Brian\n\n# \ud83d\udc0d Install\n\n```bash\npip install SynopticPy\n```\n\n```bash\nconda install -c conda-forge synopticpy\n```\n\n## Configure Token\n\n> [!IMPORTANT]\n>\n> ## \ud83c\udf9f\ufe0f To use SynopticPy you need a [Synoptic API token](https://customer.synopticdata.com/).\n\nThere are three ways you can configure your Synoptic API token:\n\n1. Set an environment variable `SYNOPTIC_TOKEN` with your token. For example, in bash:\n ```bash\n export SYNOPTIC_TOKEN=\"yourTokenHere123456789\"\n ```\n1. Create a file `~/.config/SynopticPy/config.toml` with the following\n ```toml\n token = \"yourTokenHere123456789\"\n ```\n1. Pass your token whenever you use one of SynopticPy's classes.\n ```python\n TimeSeries(\n stid=\"wbb\",\n recent=30,\n token=\"yourTokenHere123456789\"\n )\n ```\n\n# How to Cite and Acknowledge\n\nIf SynopticPy played an important role in your work, please [tell me about it](https://github.com/blaylockbk/SynopticPY/discussions/categories/show-and-tell)! Also, consider including a citation or acknowledgement in your article or product.\n\n**_Suggested Citation_**\n\n> Blaylock, B. K. (YEAR). SynopticPy: Synoptic API for Python (Version 20??.?.?) [Computer software]. https://github.com/blaylockbk/SynopticPy\n\n**_Suggested Acknowledgment_**\n\n> A portion of this work used code generously provided by Brian Blaylock's SynopticPy Python package (https://github.com/blaylockbk/SynopticPy)\n\n<br>\n<hr>\n\n> [!TIP]\n>\n> ### \ud83d\udcc8 See also my [SynopticPy Web App](https://blaylockbk.github.io/SynopticPy) which lets you plot station data in your browser powered by [pyscript](https://pyscript.net/)!\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2019-2024 Brian Blaylock Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Retrieve mesonet weather data as Polars DataFrames from Synoptic's Weather API.",
"version": "2024.12.0",
"project_urls": {
"Bug Tracker": "https://github.com/blaylockbk/SynopticPy/issues",
"Changelog": "https://github.com/blaylockbk/SynopticPy/releases",
"Documentation": "https://synopticpy.readthedocs.io/",
"Homepage": "https://github.com/blaylockbk/SynopticPy",
"Repository": "https://github.com/blaylockbk/SynopticPy"
},
"split_keywords": [
"atmosphere",
" mesonet",
" meteorology",
" weather"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3ab029b8632539cf9e95f7e7da36fdf1cd99406d421bde0b022fb5371adbd818",
"md5": "9db1b37ffd669b8db3be48c3b3e6f2d9",
"sha256": "aa31c73424f5226f256da5e322ef33065f48f63534361c688dfa429173d0cc92"
},
"downloads": -1,
"filename": "synopticpy-2024.12.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9db1b37ffd669b8db3be48c3b3e6f2d9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 21874,
"upload_time": "2024-12-05T05:51:27",
"upload_time_iso_8601": "2024-12-05T05:51:27.221017Z",
"url": "https://files.pythonhosted.org/packages/3a/b0/29b8632539cf9e95f7e7da36fdf1cd99406d421bde0b022fb5371adbd818/synopticpy-2024.12.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ceb3ee533c6a7d76cde6bba4a8db4c1de26af1cbb2e47c4bb821c0963017f138",
"md5": "1171c34845bb2e8d8644035cf391b6a5",
"sha256": "44ec3e84399510d9c10c50726a80e6b1829662837b4d6f412db0df74702d103a"
},
"downloads": -1,
"filename": "synopticpy-2024.12.0.tar.gz",
"has_sig": false,
"md5_digest": "1171c34845bb2e8d8644035cf391b6a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 27024,
"upload_time": "2024-12-05T05:51:29",
"upload_time_iso_8601": "2024-12-05T05:51:29.006021Z",
"url": "https://files.pythonhosted.org/packages/ce/b3/ee533c6a7d76cde6bba4a8db4c1de26af1cbb2e47c4bb821c0963017f138/synopticpy-2024.12.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-05 05:51:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "blaylockbk",
"github_project": "SynopticPy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "synopticpy"
}