Repository: obspy/obspy

Issue:
deprecate online NRL usage
We need to deprecate the online version of NRL. IRIS confirmed that navigational txt files from NRLv1 wont be restored to NRLv2, so the online usage version will stop working when NRLv1 gets taken down. We just need to encourage using a full downloaded NRL copy locally, sadly.
NRLv2 further work
This is a follow up ticket for NRLv2, continuing after #3058 (more details in that old ticket)

check list:
 - [x] revert a commit fixing duplicated sections in downloaded NRL v2
 - [x] statement from IRIS/EarthScope is that the navigational txt files that were included in NRLv1 will not be implemented/served in the NRLv2, even though they are present in the downloaded version, so there will be no online client support for NRL anymore once they finally pull the plug on NRLv1 which was said to happen spring 2023 ~~read NRL v2 online? at the moment not really possible, new online version does not serve the txt files with the traversal through the structure. In principle possible to parse the html files, but.. let's not~~
 - [x] add tests (for offline version)? current tests only use NRL v1 online
 - [x] NRL v2 has additional base nodes "integrated" and "soh" (in addition to "sensor" and "datalogger"), maybe check if we want to implement that too, but might be for another PR
 - [x] fix some issues with units in the first datalogger stage when combining responses using the NRL v2
 - [ ] ...
 - [x] add changelog


Discussion:
Happy to have people volunteer to add a client for the new webservice though :cricket: 



Resolving patch:
diff --git a/obspy/clients/nrl/__init__.py b/obspy/clients/nrl/__init__.py
--- a/obspy/clients/nrl/__init__.py
+++ b/obspy/clients/nrl/__init__.py
@@ -16,6 +16,15 @@
 Basic Usage
 -----------
 
+.. warning::
+    Connecting to NRL hosted online is deprecated. The new NRLv2 will stop
+    providing navigational information in machine readable form in favor of the
+    html navigation, so the existing client for online use will stop working
+    when the original NRLv1 is taken offline (announced for Spring 2023).
+    Please consider using a full downloaded copy of the NRL (v1 or v2,
+    `instructions on NRL homepage <https://ds.iris.edu/ds/nrl/>`_) providing a
+    local path, e.g. ``nrl = NRL('./downloads/NRL')``.
+
 The first step is to initialize a NRL client object. A client object can be
 initialized either with the base URL of a NRL hosted on a web server or with a
 local directory path to a downloaded and unpacked NRL zip file. The default is
diff --git a/obspy/clients/nrl/client.py b/obspy/clients/nrl/client.py
--- a/obspy/clients/nrl/client.py
+++ b/obspy/clients/nrl/client.py
@@ -24,6 +24,7 @@
 import obspy
 from obspy.core.compatibility import get_text_from_response
 from obspy.core.inventory.util import _textwrap
+from obspy.core.util.decorator import deprecated
 
 
 # Simple cache for remote NRL access. The total data amount will always be
@@ -38,6 +39,10 @@ class NRL(object):
     https://ds.iris.edu/NRL/
 
     Created with a URL for remote access or filesystem accessing a local copy.
+
+    .. warning::
+        Remote access to online NRL is deprecated as it will stop working in
+        Spring 2023 due to server side changes.
     """
     _index = 'index.txt'
 
@@ -331,9 +336,27 @@ def _read_resp(self, path):
 
 class RemoteNRL(NRL):
     """
+    DEPRECATED
+
     Subclass of NRL for accessing remote copy of NRL.
+
+    Direct access to online NRL is deprecated as it will stop working when the
+    original NRLv1 gets taken offline (Spring 2023), please consider working
+    locally with a downloaded full copy of the old NRLv1 or new NRLv2 following
+    instructions on the
+    `NRL landing page <https://ds.iris.edu/ds/nrl/>`_.
     """
+    @deprecated()
     def __init__(self, root='https://ds.iris.edu/NRL'):
+        """
+        DEPRECATED
+
+        Direct access to online NRL is deprecated as it will stop working when
+        the original NRLv1 gets taken offline (Spring 2023), please consider
+        working locally with a downloaded full copy of the old NRLv1 or new
+        NRLv2 following instructions on the
+        `NRL landing page <https://ds.iris.edu/ds/nrl/>`_.
+        """
         self.root = root
         super(self.__class__, self).__init__()
 


Test patch: