cdasws 1.8.12__py3-none-any.whl → 1.8.14__py3-none-any.whl

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.
cdasws/__init__.py CHANGED
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2018-2025 United States Government as represented by
27
+ # Copyright (c) 2018-2026 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.
@@ -35,7 +35,7 @@
35
35
  Package for accessing the Coordinate Data Analysis System (CDAS)
36
36
  web services <https://cdaweb.gsfc.nasa.gov/WebServices/REST/>.<br>
37
37
 
38
- Copyright &copy; 2018-2025 United States Government as represented by the
38
+ Copyright &copy; 2018-2026 United States Government as represented by the
39
39
  National Aeronautics and Space Administration. No copyright is claimed in
40
40
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
41
41
 
@@ -55,7 +55,7 @@ Notes
55
55
  """
56
56
 
57
57
 
58
- __version__ = "1.8.12"
58
+ __version__ = "1.8.14"
59
59
 
60
60
 
61
61
  #
@@ -82,4 +82,4 @@ NAMESPACES = {
82
82
  #
83
83
  # For backward compatibility with cdasws versions < 1.8.12.
84
84
  #
85
- from cdasws.cdasws import *
85
+ from cdasws.cdasws import * # pylint: disable=wrong-import-position
cdasws/__main__.py CHANGED
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2018-2025 United States Government as represented by
27
+ # Copyright (c) 2018-2026 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,7 +34,7 @@
34
34
  Example Coordinate Data Analysis System (CDAS) web service client.
35
35
  Includes example calls to most of the web services.
36
36
 
37
- Copyright &copy; 2018-2025 United States Government as represented by the
37
+ Copyright &copy; 2018-2026 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
  """
@@ -52,6 +52,7 @@ from cdasws.cdasws import CdasWs
52
52
  from cdasws.timeinterval import TimeInterval
53
53
  from cdasws.datarequest import GraphOptions, ImageFormat, Overplot, TextFormat
54
54
  from cdasws.datarepresentation import DataRepresentation
55
+ from cdasws.doi import get_doi_landing_page_url
55
56
 
56
57
 
57
58
  logging.basicConfig()
@@ -147,7 +148,7 @@ def example(
147
148
 
148
149
  cdas = CdasWs(endpoint=endpoint, ca_certs=ca_certs,
149
150
  disable_ssl_certificate_validation=
150
- disable_ssl_certificate_validation,
151
+ disable_ssl_certificate_validation,
151
152
  disable_cache = disable_cache, user_agent='Example')
152
153
 
153
154
  print(cdas.get_observatory_groups(
@@ -166,7 +167,7 @@ def example(
166
167
  #print(' ', json.dumps(dataset, indent=4))
167
168
 
168
169
  print('DOI landing page:',
169
- cdas.get_doi_landing_page_url('10.48322/e0dc-0h53'))
170
+ get_doi_landing_page_url('10.48322/e0dc-0h53'))
170
171
 
171
172
  print('citation = ' + cdas.get_citation('10.48322/541v-1f57'))
172
173
 
cdasws/cdasws.py CHANGED
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2018-2025 United States Government as represented by
27
+ # Copyright (c) 2018-2026 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.
@@ -35,7 +35,7 @@
35
35
  Module for accessing the Coordinate Data Analysis System (CDAS)
36
36
  web services <https://cdaweb.gsfc.nasa.gov/WebServices/REST/>.<br>
37
37
 
38
- Copyright &copy; 2018-2025 United States Government as represented by the
38
+ Copyright &copy; 2018-2026 United States Government as represented by the
39
39
  National Aeronautics and Space Administration. No copyright is claimed in
40
40
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
41
41
 
@@ -60,19 +60,19 @@ import os
60
60
  import platform
61
61
  import logging
62
62
  import re
63
- from importlib.util import find_spec
63
+ #from importlib.util import find_spec
64
64
  import urllib.parse
65
65
  from urllib.parse import urlparse
66
- import json
66
+ #import json
67
67
  from operator import itemgetter
68
68
  import time
69
- from datetime import datetime, timedelta, timezone
69
+ from datetime import datetime, timedelta
70
70
  import xml.etree.ElementTree as ET
71
71
  from tempfile import mkstemp
72
72
  from typing import Any, Callable, Dict, List, Tuple, Union
73
73
 
74
74
  import requests
75
- import dateutil.parser
75
+ #import dateutil.parser
76
76
 
77
77
  from cdasws.datarepresentation import DataRepresentation
78
78
  from cdasws.datarequest import AudioRequest, DataRequest
@@ -80,6 +80,8 @@ from cdasws.datarequest import CdfFormat, CdfRequest, Compression
80
80
  from cdasws.datarequest import ImageFormat, GraphOptions, GraphRequest
81
81
  from cdasws.datarequest import TextFormat, TextRequest, ThumbnailRequest
82
82
  from cdasws.timeinterval import TimeInterval
83
+ from cdasws.doi import get_doi_landing_page_url
84
+ from cdasws import __version__, RETRY_LIMIT, NAMESPACES as NS
83
85
 
84
86
 
85
87
  # requires python >= 3.4
@@ -143,8 +145,6 @@ try:
143
145
  except ImportError:
144
146
  CACHE_AVAILABLE = False
145
147
 
146
- from cdasws import __version__, RETRY_LIMIT, NAMESPACES as NS
147
-
148
148
 
149
149
  def _get_data_progress(
150
150
  progress: float,
@@ -919,6 +919,9 @@ class CdasWs:
919
919
  Returns a URL to the given Digital Object Identifier's landing
920
920
  page (metadata for the DOI).
921
921
 
922
+ Note: this method is deprecated. You should call
923
+ doi.get_doi_landing_page_url directly.
924
+
922
925
  Parameters
923
926
  ----------
924
927
  doi
@@ -929,9 +932,7 @@ class CdasWs:
929
932
  A URL to the DOI's landing page.
930
933
  """
931
934
 
932
- if not doi.startswith('http'):
933
- return 'https://doi.org/' + doi
934
- return doi
935
+ return get_doi_landing_page_url(doi)
935
936
 
936
937
 
937
938
  @staticmethod
cdasws/datarequest.py CHANGED
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2019-2024 United States Government as represented by
27
+ # Copyright (c) 2019-2026 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.
@@ -36,7 +36,7 @@ Package defining classes to represent the DataRequestEntity and its
36
36
  sub-classes from
37
37
  <https://cdaweb.gsfc.nasa.gov/WebServices/REST/CDAS.xsd>.<br>
38
38
 
39
- Copyright &copy; 2019-2024 United States Government as represented by the
39
+ Copyright &copy; 2019-2026 United States Government as represented by the
40
40
  National Aeronautics and Space Administration. No copyright is claimed in
41
41
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
42
42
  """
@@ -350,7 +350,6 @@ class DataRequest(metaclass=ABCMeta): # pylint: disable=too-few-public-methods
350
350
  string XML representation of this object.
351
351
  """
352
352
 
353
- #return ET.tostring(self.xml_element(), encoding="utf-8", method='xml', xml_declaration=True)
354
353
  return ET.tostring(self.xml_element(), encoding="utf-8", method='xml')
355
354
 
356
355
 
cdasws/doi.py ADDED
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env python3
2
+
3
+ #
4
+ # NOSA HEADER START
5
+ #
6
+ # The contents of this file are subject to the terms of the NASA Open
7
+ # Source Agreement (NOSA), Version 1.3 only (the "Agreement"). You may
8
+ # not use this file except in compliance with the Agreement.
9
+ #
10
+ # You can obtain a copy of the agreement at
11
+ # docs/NASA_Open_Source_Agreement_1.3.txt
12
+ # or
13
+ # https://cdaweb.gsfc.nasa.gov/WebServices/NASA_Open_Source_Agreement_1.3.txt.
14
+ #
15
+ # See the Agreement for the specific language governing permissions
16
+ # and limitations under the Agreement.
17
+ #
18
+ # When distributing Covered Code, include this NOSA HEADER in each
19
+ # file and include the Agreement file at
20
+ # docs/NASA_Open_Source_Agreement_1.3.txt. If applicable, add the
21
+ # following below this NOSA HEADER, with the fields enclosed by
22
+ # brackets "[]" replaced with your own identifying information:
23
+ # Portions Copyright [yyyy] [name of copyright owner]
24
+ #
25
+ # NOSA HEADER END
26
+ #
27
+ # Copyright (c) 2025 United States Government as represented by
28
+ # the National Aeronautics and Space Administration. No copyright is
29
+ # claimed in the United States under Title 17, U.S.Code. All Other
30
+ # Rights Reserved.
31
+ #
32
+
33
+
34
+ """
35
+ Module defines utility functions related to Digital Object Identifiers
36
+ (DOI).<br>
37
+
38
+ Copyright &copy; 2025 United States Government as represented by the
39
+ National Aeronautics and Space Administration. No copyright is claimed in
40
+ the United States under Title 17, U.S.Code. All Other Rights Reserved.
41
+ """
42
+
43
+
44
+ def get_canonical_doi(
45
+ doi: str
46
+ ) -> str:
47
+ """
48
+ Returns a canonical representation (no leading https://doi.org/ and
49
+ lower case) Digital Object Identifier (DOI) value.
50
+
51
+ Parameters
52
+ ----------
53
+ doi
54
+ digital object identifier.
55
+ Returns
56
+ -------
57
+ str
58
+ The canonical DOI value.
59
+ """
60
+ return doi.replace('https://doi.org/', '').lower()
61
+
62
+
63
+ def get_doi_landing_page_url(
64
+ doi: str
65
+ ) -> str:
66
+ """
67
+ Returns a URL to the given Digital Object Identifier's landing
68
+ page (metadata for the DOI).
69
+
70
+ Parameters
71
+ ----------
72
+ doi
73
+ digital object identifier.
74
+ Returns
75
+ -------
76
+ str
77
+ A URL to the DOI's landing page.
78
+ """
79
+
80
+ if not doi.startswith('http'):
81
+ return 'https://doi.org/' + doi
82
+ return doi
83
+
84
+
85
+ def get_doi_badge_url(
86
+ doi: str
87
+ ) -> str:
88
+ """
89
+ Returns a URL to the given Digital Object Identifier's badge.
90
+
91
+ Parameters
92
+ ----------
93
+ doi
94
+ digital object identifier.
95
+ Returns
96
+ -------
97
+ str
98
+ A URL to the DOI's badge.
99
+ """
100
+
101
+ canonical_doi = get_canonical_doi(doi)
102
+
103
+ return 'https://img.shields.io/badge/DOI-' + \
104
+ canonical_doi.replace('-', '--') + '-blue'
105
+
106
+
107
+ def get_doi_hdp_url(
108
+ doi: str
109
+ ) -> str:
110
+ """
111
+ Returns a URL to the given Digital Object Identifier's Heliophysics
112
+ Data Portal (HDP) page.
113
+
114
+ Parameters
115
+ ----------
116
+ doi
117
+ digital object identifier.
118
+ Returns
119
+ -------
120
+ str
121
+ A URL to the DOI's HDP page.
122
+ """
123
+
124
+ canonical_doi = get_canonical_doi(doi)
125
+
126
+ return 'https://heliophysicsdata.gsfc.nasa.gov/WS/hdp/1/Spase/' \
127
+ 'NumericalData;DisplayData?DOI=' + canonical_doi
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdasws
3
- Version: 1.8.12
3
+ Version: 1.8.14
4
4
  Summary: NASA's Coordinated Data Analysis System Web Service Client Library
5
5
  Home-page: https://cdaweb.gsfc.nasa.gov/WebServices/REST
6
6
  Author: Bernie Harris
7
7
  Author-email: NASA-SPDF-Support@nasa.onmicrosoft.com
8
8
  License: NOSA
9
- Keywords: heliophysics,coordinated data analysis,multi-mission,multi-instrument,space physics,spdf,cdaweb
9
+ Keywords: heliophysics,coordinated data analysis,multi-mission,multi-instrument,space physics,SPDF,CDAweb,HDRL,HelioCloud
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Console
12
12
  Classifier: Environment :: Web Environment
@@ -16,6 +16,7 @@ Classifier: Intended Audience :: System Administrators
16
16
  Classifier: License :: OSI Approved :: NASA Open Source Agreement v1.3 (NASA-1.3)
17
17
  Classifier: Operating System :: OS Independent
18
18
  Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3
19
20
  Classifier: Topic :: Scientific/Engineering :: Physics
20
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
22
  Description-Content-Type: text/markdown
@@ -57,12 +58,13 @@ and can return data from any of
57
58
  [pandas.DataFrame](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html)
58
59
  with all source and
59
60
  [ISTP/SPDF](https://spdf.gsfc.nasa.gov/sp_use_of_cdf.html) metadata.
60
- Note that this package is included in the [HelioCloud](https://heliocloud.org/)
61
+ Note that this package is included in the
62
+ <a href="https://heliocloud.org"><img src="/logos/HelioCloud.png" width="100" height="auto" alt="HelioCloud" /></a>
61
63
  base image, so there is no need to install it there.
62
64
  Frequently asked questions concerning this library are at
63
65
  [FAQ](https://cdaweb.gsfc.nasa.gov/WebServices/REST/py/FAQ.html).
64
66
  For more general details about the CDAS web services, see
65
- https://cdaweb.gsfc.nasa.gov/WebServices/REST/.
67
+ [https://cdaweb.gsfc.nasa.gov/WebServices/REST/](https://cdaweb.gsfc.nasa.gov/WebServices/REST/).
66
68
 
67
69
  ## Code Example
68
70
 
@@ -0,0 +1,14 @@
1
+ cdasws/__init__.py,sha256=aOLTuB9fD3pn17_-N6GnGhilYVg9v1FKY3rTmyb8cqU,2629
2
+ cdasws/__main__.py,sha256=6XEenCcOcxCM9POH2BiTM9z6cnHqZDQU8gZ4Ia7xqoA,13515
3
+ cdasws/cdasws.py,sha256=KN_n2MwfR8QY0nsUxr6fz-3ZMsoIZEvXTC8Kp_QcyeU,91514
4
+ cdasws/datarepresentation.py,sha256=kKgAKCA4uzGoBQ8r8jbXstBg8SCg_EQtsoGhO8kIpco,2164
5
+ cdasws/datarequest.py,sha256=dlAq9H1Tn8COPOWurv3w5wLGWoFNDQXgGQtROlK6zxg,28978
6
+ cdasws/doi.py,sha256=ph0uQ_dM081V4d_uFN1lNCn7-UxHERIyYbTO3JqyqMQ,3172
7
+ cdasws/timeinterval.py,sha256=UcKB-rFSk2eeaw0a29gOQQq7rNY0ab4Qwfz4iwJFelg,7839
8
+ cdasws-1.8.14.dist-info/licenses/LICENSE,sha256=9VDxMcDDn3_T-sDQTMPxmiPZBDkPIiTO4OzYK5olDmk,12589
9
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ tests/test_cdasws.py,sha256=DsKesU19_9zUIO1a7oyWWtywBGN7gjdQHFLMGUZ4X8c,24395
11
+ cdasws-1.8.14.dist-info/METADATA,sha256=YYKsnwXNNcBPcZ5232vHDDQtjvGFi-6DeZ8GA8hrInE,7252
12
+ cdasws-1.8.14.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
13
+ cdasws-1.8.14.dist-info/top_level.txt,sha256=GyIvHk5F6ysnTdDfnQsjZbTBt_EYrKyC0oeiIt9l-AE,7
14
+ cdasws-1.8.14.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- cdasws/__init__.py,sha256=_IYGnCuHvpHeTdiA4DLwqIm0HV6H2H_DK5l_1uA5hbQ,2588
2
- cdasws/__main__.py,sha256=ABTe9FhZKTai2onoUTfN-0CBLSqzOEHw9N4yUKoqsaM,13473
3
- cdasws/cdasws.py,sha256=wHyXD9CjLHUc8rc8zUASfLJkUCdVvc22zfzAJCZDIaU,91424
4
- cdasws/datarepresentation.py,sha256=kKgAKCA4uzGoBQ8r8jbXstBg8SCg_EQtsoGhO8kIpco,2164
5
- cdasws/datarequest.py,sha256=fQVroT8RXYhJLG7_y-HO3ABnJUQJjWGFPeLNrtwbWtk,29080
6
- cdasws/timeinterval.py,sha256=UcKB-rFSk2eeaw0a29gOQQq7rNY0ab4Qwfz4iwJFelg,7839
7
- cdasws-1.8.12.dist-info/licenses/LICENSE,sha256=9VDxMcDDn3_T-sDQTMPxmiPZBDkPIiTO4OzYK5olDmk,12589
8
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- tests/test_cdasws.py,sha256=DsKesU19_9zUIO1a7oyWWtywBGN7gjdQHFLMGUZ4X8c,24395
10
- cdasws-1.8.12.dist-info/METADATA,sha256=NLFbgMvIG6lrB4ATvkbqCusN5SHdzDT66MA7AeubfH8,7059
11
- cdasws-1.8.12.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
12
- cdasws-1.8.12.dist-info/top_level.txt,sha256=GyIvHk5F6ysnTdDfnQsjZbTBt_EYrKyC0oeiIt9l-AE,7
13
- cdasws-1.8.12.dist-info/RECORD,,