Skip to content

v0.20.0

Latest

Choose a tag to compare

@github-actions github-actions released this 05 Apr 23:09

Release Notes

This release introduces a dedicated ogcapi module that consolidates all OGC API-based web service clients under a single, extensible framework. The module exposes a new OGCAPIBase base class that handles pagination, CQL filtering, geometry queries, feature ID lookups, bounding-box queries, User-Agent identification, optional API-key injection, and automatic cache eviction for error responses. The existing GeoConnex and FabricData classes have been refactored to inherit from OGCAPIBase, and a new NWIS class has been added to access the USGS Water Data OGC API (https://api.waterdata.usgs.gov/ogcapi/v0) as USGS migrates its services to the OGC API standard.

New Features

  • Add NWIS class for accessing the new USGS Water Data OGC API (https://api.waterdata.usgs.gov/ogcapi/v0). USGS is migrating its web services to the OGC API standard; this class provides access to monitoring locations, daily/continuous observations, field/channel measurements, and reference code tables. The class reads the USGS_API_KEY environment variable automatically for higher rate limits.
  • Add NLDI.get_characteristics_byid method for retrieving local, total, or divergence-routed catchment characteristics for a specific feature directly from the NLDI API.
  • Add trim_tolerance parameter to NLDI.navigate_byid and NLDI.navigate_bybox for controlling how aggressively the first flowline is trimmed when trim_start=True.
  • Add StreamCat.changelog, StreamCat.data_dictionary, and StreamCat.all_metrics_bycomid methods to expose additional StreamCat API endpoints.

Internal Changes

  • Move GeoConnex and FabricData from core to the new dedicated ogcapi module alongside the new NWIS class.
  • Introduce OGCAPIBase as a reusable base class for all OGC API services. GeoConnex, FabricData, and NWIS now inherit from it, making it straightforward to add further OGC API-based services.
  • OGCAPIBase now sends a User-Agent header (pynhd/<version>) on every request so API providers can identify traffic from HyRiver.
  • FabricData and NWIS read the USGS_API_KEY environment variable when no explicit api_key is passed.
  • Error responses (e.g., rate-limit or server errors) are automatically evicted from the HTTP cache so they do not persist across retries.
  • Fix type annotations across core, network_tools, nhdplus_derived, ogcapi, pygeoapi, and pynhd modules to pass strict Pyright type-checking.