Skip to main content

A Python API wrapper for the Wisconsin environmental mesonet API: Wisconet

Project description

Wiscopy

Python wrapper for Wisconet. Currently supporting API v1.

Install

From PyPI

base install

To install wiscopy from PyPI run

python -m pip install wiscopy

install with plotting library dependencies

python -m pip install 'wiscopy[plot]'

From conda-forge

To install and add wiscopy to a project from conda-forge with Pixi, from the project directory run

pixi add wiscopy

and to install into a particular conda environment with conda, in the activated environment run

conda install --channel conda-forge wiscopy

Usage

Fetch data from multiple stations, create a Dataframe, and plot.

import nest_asyncio
import hvplot.pandas  # needed for df.hvplot()
import holoviews as hv
from datetime import datetime
from wiscopy.interface import Wisconet

hv.extension('bokeh')
hv.plotting.bokeh.element.ElementPlot.active_tools = ["box_zoom"]
nest_asyncio.apply()  # needed to run in notebook

w = Wisconet()
df = w.get_data(
    station_ids=["maple", "arlington"],
    start_time="2025-01-01",
    end_time="2025-02-01",
    fields=["60min_air_temp_f_avg"]
)
df.hvplot(
    y="value",
    by="station_id",
    title="60min_air_temp_f_avg",
    ylabel=df.final_units.iloc[0],
    grid=True,
    rot=90,
)

Specific data over a specific time period

More examples

see more examples in notebooks/examples.ipynb, or run

pixi run start

Wisconet

Current stations

Wisconet's list of current stations shows all active station names. You can get that list of strings via the API as follows:

from wiscopy.interface import Wisconet

w = Wisconet()
station_names = w.all_station_names()

Wisconet also provides a map of those stations with a dropdown menu including some of the currently available fields/variables. You can determine the fields available per station from the API with:

from wiscopy.interface import Wisconet

w = Wisconet()
station_names = w.all_station_names()
this_station = w.get_station(station_names[0])
fields = this_station.get_field_names()

dev install (contribute!)

1. install pixi

See pixi install guide.

2. check out from repo

git clone git@github.com:UW-Madison-DSI/wiscopy.git

3. install local editable version

cd wiscopy
pixi install

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

wiscopy-0.1.4.tar.gz (69.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wiscopy-0.1.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file wiscopy-0.1.4.tar.gz.

File metadata

  • Download URL: wiscopy-0.1.4.tar.gz
  • Upload date:
  • Size: 69.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wiscopy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f450ec8dde575fab1f87f636c72628c2d27c7f1dda54151c70be461b6b922748
MD5 9b7dfab7641f94553c18cab24e9bf4ae
BLAKE2b-256 e5520e401fabe784a4702e29abeaabe40a58fc43b7dd121bfe0b32b07c116416

See more details on using hashes here.

Provenance

The following attestation bundles were made for wiscopy-0.1.4.tar.gz:

Publisher: release.yml on UW-Madison-DSI/wiscopy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wiscopy-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: wiscopy-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wiscopy-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fb21c2128a397edac1308f6e0941000b0e29199437e3e6817b9388e7802372f8
MD5 f80409fc067eb39e5696da56efe08cc5
BLAKE2b-256 4ebdb9e94af9f611089b45e57d15fc1f97b64bd504d33390ba9aa51859a43dee

See more details on using hashes here.

Provenance

The following attestation bundles were made for wiscopy-0.1.4-py3-none-any.whl:

Publisher: release.yml on UW-Madison-DSI/wiscopy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page