Python wrapper for Wisconet. Currently supporting API v1.
- Easy to use interface: simply specify the stations, datetime range, and fields you want
- Data automatically formatted into a pandas DataFrame
- Fetch large amounts of data with transparent concurrency
- Automatically respect Wisconet rate limiting (20 requests / 20 seconds)
To install wiscopy from PyPI run
python -m pip install wiscopypython -m pip install 'wiscopy[plot]'To install and add wiscopy to a project from conda-forge with Pixi, from the project directory run
pixi add wiscopyand to install into a particular conda environment with conda, in the activated environment run
conda install --channel conda-forge wiscopyimport 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"]
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,
)see more examples in notebooks/examples.ipynb, or run
pixi run startWisconet's list of current stations shows all active station names. You can get also that list of strings in wiscopy with:
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 in wiscopy 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()See pixi install guide.
git clone git@github.com:UW-Madison-DSI/wiscopy.gitcd wiscopy
pixi installpixi run testpixi run -e dev ruff check --fix . Confirm github workflows will pass before pushing: pixi lock file sync, format, lint, tests
pixi run pre-push pixi run buildpixi run -e clean-room test-wheelPull requests welcome! All pull requests must be formated, linted and pass tests
