hdpws 0.6.19__tar.gz → 0.6.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hdpws
3
- Version: 0.6.19
3
+ Version: 0.6.22
4
4
  Summary: NASA's Heliophysics Data Portal Web Service Client Library
5
5
  Home-page: https://heliophysicsdata.gsfc.nasa.gov/WebServices
6
6
  Author: Bernie Harris
@@ -44,13 +44,11 @@ To run the included example, do the following
44
44
 
45
45
  ---
46
46
 
47
- The following [Jupyter notebooks](https://jupyter.org/) demonstrate
47
+ Also, the following [Jupyter notebooks](https://jupyter.org/) demonstrate
48
48
  different features of the library:
49
- 1. [Simple Query Example](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.html) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.ipynb))demonstrating a simple query.
50
- 2. [Example with data retrieval](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.html) using [cdasws](https://pypi.org/project/cdasws/) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.ipynb)).
49
+ 1. [Simple Query Example](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.html) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.ipynb)) demonstrating a simple query. [Launch on Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main?labpath=HdpWsExample.ipynb).
50
+ 2. [Example with data retrieval](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.html) using [cdasws](https://pypi.org/project/cdasws/) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.ipynb)). [Launch on Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main?labpath=HdpWsExampleWithCdasWs.ipynb).
51
51
 
52
- These notebooks will eventually be available on
53
- [Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main).
54
52
 
55
53
  ## Motivation
56
54
 
@@ -20,13 +20,11 @@ To run the included example, do the following
20
20
 
21
21
  ---
22
22
 
23
- The following [Jupyter notebooks](https://jupyter.org/) demonstrate
23
+ Also, the following [Jupyter notebooks](https://jupyter.org/) demonstrate
24
24
  different features of the library:
25
- 1. [Simple Query Example](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.html) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.ipynb))demonstrating a simple query.
26
- 2. [Example with data retrieval](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.html) using [cdasws](https://pypi.org/project/cdasws/) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.ipynb)).
25
+ 1. [Simple Query Example](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.html) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.ipynb)) demonstrating a simple query. [Launch on Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main?labpath=HdpWsExample.ipynb).
26
+ 2. [Example with data retrieval](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.html) using [cdasws](https://pypi.org/project/cdasws/) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.ipynb)). [Launch on Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main?labpath=HdpWsExampleWithCdasWs.ipynb).
27
27
 
28
- These notebooks will eventually be available on
29
- [Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main).
30
28
 
31
29
  ## Motivation
32
30
 
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2023 United States Government as represented by
27
+ # Copyright (c) 2023-2024 United States Government as represented by
28
28
  # the National Aeronautics and Space Administration. No copyright is
29
29
  # claimed in the United States under Title 17, U.S.Code. All Other
30
30
  # Rights Reserved.
@@ -34,14 +34,14 @@
34
34
  Package for accessing the NASA's Heliophysics Data Portal (HDP) web
35
35
  services https://heliophysicsdata.gsfc.nasa.gov/WebServices/.
36
36
 
37
- Copyright © 2023 United States Government as represented by the
37
+ Copyright © 2023-2024 United States Government as represented by the
38
38
  National Aeronautics and Space Administration. No copyright is claimed in
39
39
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
40
40
 
41
41
  """
42
42
 
43
43
 
44
- __version__ = "0.6.19"
44
+ __version__ = "0.6.22"
45
45
 
46
46
 
47
47
  #
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2023 United States Government as represented by
27
+ # Copyright (c) 2023-2024 United States Government as represented by
28
28
  # the National Aeronautics and Space Administration. No copyright is
29
29
  # claimed in the United States under Title 17, U.S.Code. All Other
30
30
  # Rights Reserved.
@@ -845,6 +845,44 @@ class HdpWs:
845
845
  return self.__get_complex_resource([ResourceType.DOCUMENT], query)
846
846
 
847
847
 
848
+ def get_spase_service(
849
+ self,
850
+ query: Dict
851
+ ) -> Dict:
852
+ """
853
+ Gets the specified SPASE Service documents from HDP.
854
+
855
+ Parameters
856
+ ----------
857
+ query
858
+ Dictionary containing query parameters and values. For
859
+ example,<pre>
860
+ query = {
861
+ 'ResourceID': 'spase://CCMC/Service/InstantRun',
862
+ 'Description': '"Instan-Run"'
863
+ }</pre>
864
+
865
+ Returns
866
+ -------
867
+ Dict
868
+ Dictionary containing a 'Result' key with a value of an
869
+ ElementTree representation of the results as described by
870
+ <https://heliophysicsdata.gsfc.nasa.gov/WebServices/hdpspase.xsd>
871
+ with the addition of the following key/values:<br>
872
+ - HttpStatus: with the value of the HTTP status code.
873
+ Successful == 200.<br>
874
+ When HttpStatus != 200:<br>
875
+ - HttpText: containing a string representation of the HTTP
876
+ entity body.<br>
877
+ When HttpText is a standard HDP WS error entity body the
878
+ following key/values (convenience to avoid parsing
879
+ HttpStatus):<br>
880
+ - ErrorMessage: value from HttpText.<br>
881
+ - ErrorDescription: value from HttpText.<br>
882
+ """
883
+ return self.__get_complex_resource([ResourceType.SERVICE], query)
884
+
885
+
848
886
  def get_spase_software(
849
887
  self,
850
888
  query: Dict
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hdpws
3
- Version: 0.6.19
3
+ Version: 0.6.22
4
4
  Summary: NASA's Heliophysics Data Portal Web Service Client Library
5
5
  Home-page: https://heliophysicsdata.gsfc.nasa.gov/WebServices
6
6
  Author: Bernie Harris
@@ -44,13 +44,11 @@ To run the included example, do the following
44
44
 
45
45
  ---
46
46
 
47
- The following [Jupyter notebooks](https://jupyter.org/) demonstrate
47
+ Also, the following [Jupyter notebooks](https://jupyter.org/) demonstrate
48
48
  different features of the library:
49
- 1. [Simple Query Example](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.html) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.ipynb))demonstrating a simple query.
50
- 2. [Example with data retrieval](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.html) using [cdasws](https://pypi.org/project/cdasws/) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.ipynb)).
49
+ 1. [Simple Query Example](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.html) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExample.ipynb)) demonstrating a simple query. [Launch on Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main?labpath=HdpWsExample.ipynb).
50
+ 2. [Example with data retrieval](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.html) using [cdasws](https://pypi.org/project/cdasws/) ([ipynb file](https://heliophysicsdata.gsfc.nasa.gov/WebServices/jupyter/HdpWsExampleWithCdasWs.ipynb)). [Launch on Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main?labpath=HdpWsExampleWithCdasWs.ipynb).
51
51
 
52
- These notebooks will eventually be available on
53
- [Binder](https://mybinder.org/v2/gh/berniegsfc/hdpws-notebooks/main).
54
52
 
55
53
  ## Motivation
56
54
 
@@ -10,7 +10,7 @@ README = (HERE / "README.md").read_text()
10
10
  # This call to setup() does all the work
11
11
  setup(
12
12
  name="hdpws",
13
- version="0.6.19",
13
+ version="0.6.22",
14
14
  description="NASA's Heliophysics Data Portal Web Service Client Library",
15
15
  long_description=README,
16
16
  long_description_content_type="text/markdown",
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2023 United States Government as represented by
27
+ # Copyright (c) 2023-2024 United States Government as represented by
28
28
  # the National Aeronautics and Space Administration. No copyright is
29
29
  # claimed in the United States under Title 17, U.S.Code. All Other
30
30
  # Rights Reserved.
@@ -60,7 +60,8 @@ class TestHdpWs(unittest.TestCase):
60
60
 
61
61
  def __init__(self, *args, **kwargs):
62
62
  super(TestHdpWs, self).__init__(*args, **kwargs)
63
- self._hdp = HdpWs(endpoint='http://localhost:8080/exist/restxq/')
63
+ # self._hdp = HdpWs(endpoint='http://localhost:8080/exist/restxq/')
64
+ self._hdp = HdpWs(endpoint='http://localhost:8100/exist/restxq/')
64
65
 
65
66
 
66
67
  def test_get_application_interfaces(self):
@@ -203,10 +204,10 @@ class TestHdpWs(unittest.TestCase):
203
204
  result = result['Result']
204
205
  result_id_elements = result.findall('.//ResourceID', namespaces=NS)
205
206
  result_ids = list(map(lambda e: e.text, result_id_elements))
206
- self.assertTrue(len(result_ids) == 3)
207
+ # self.assertTrue(len(result_ids) == 3)
207
208
  # above should be == 2 when duplicate is removed from hdp and
208
209
  # then the following will work
209
- #self.assertTrue(sorted(result_ids) == sorted(resource_ids))
210
+ self.assertTrue(sorted(result_ids) == sorted(resource_ids))
210
211
 
211
212
 
212
213
  def test_get_spase_if_modified_since(self):
@@ -412,6 +413,27 @@ class TestHdpWs(unittest.TestCase):
412
413
  self.assertTrue(result_ids[0] == 'spase://SMWG/Document/HPDE/Policy/HP_DataPolicy_v1.2')
413
414
 
414
415
 
416
+ def test_get_spase_service(self):
417
+ """
418
+ Test for get_spase_service function.
419
+ """
420
+
421
+ query = {
422
+ 'ResourceID': 'spase://CCMC/Service/InstantRun',
423
+ 'Description': '"Instant-Run"'
424
+ }
425
+
426
+ result = self._hdp.get_spase_service(query)
427
+
428
+ self.assertEqual(result['HttpStatus'], 200)
429
+ result = result['Result']
430
+ result_id_elements = result.findall('.//ResourceID',
431
+ namespaces=NS)
432
+ result_ids = list(map(lambda e: e.text, result_id_elements))
433
+ self.assertTrue(len(result_ids) == 1)
434
+ self.assertTrue(result_ids[0] == 'spase://CCMC/Service/InstantRun')
435
+
436
+
415
437
  def test_get_spase_software(self):
416
438
  """
417
439
  Test for get_spase_software function.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes