pyiem.tracker module#

IEM Tracker Related Stuff.

class pyiem.tracker.TrackerEngine(icursor, pcursor, maxactions=0)[source]#

Bases: object

A processing engine of tracking offline/online events

send_emails()[source]#

Send out those SPAM emails!

offline_logic(sid, ob, pnetwork, nt)[source]#

offline logic

Parameters:
  • sid (str) – site identifier

  • ob (dict) – observation dictionary

  • pnetwork (str) – Portfolio name of this network

  • nt (dict) – provider of station metadata

online_logic(sid, offline, ob, pnetwork, nt)[source]#

online logic

Parameters:
  • sid (str) – site identifier

  • offline (dict) – dictionary of offline metadata

  • ob (dict) – observation dictionary

  • pnetwork (str) – Portfolio name of this network

  • nt (dict) – provider of station metadata

process_network(obs, pnetwork, nt, threshold)[source]#

Process a list of dicts representing the network’s observations

Parameters:
  • obs (list) – list of dicts representing the network obs

  • pnetwork (str) – the identifier of this network used in Portfolio DB

  • nt (NetworkTable) – dictionary provider of station metadata

  • threshold (datetime) – datetime instance with tzinfo set represeting the minimum time a site is considered to be ‘online’ within

pyiem.tracker.loadqc(cursor=None, date=None)[source]#

Load the current IEM Tracker QC’d variables

Parameters:
  • cursor (cursor,optional) – Optionally provided database cursor

  • date (date,optional) – Defaults to today, which tickets are valid for now