gdex-api-client 2.0.1__tar.gz → 2.0.3__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.
- {gdex_api_client-2.0.1/src/gdex_api_client.egg-info → gdex_api_client-2.0.3}/PKG-INFO +1 -1
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/pyproject.toml +1 -1
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client/gdex_client.py +10 -12
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3/src/gdex_api_client.egg-info}/PKG-INFO +1 -1
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/LICENSE +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/docs/README.md +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/setup.cfg +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client/__init__.py +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client.egg-info/SOURCES.txt +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client.egg-info/dependency_links.txt +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client.egg-info/entry_points.txt +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client.egg-info/requires.txt +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client.egg-info/top_level.txt +0 -0
- {gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/test/test_rdams_client.py +0 -0
|
@@ -26,6 +26,7 @@ import json
|
|
|
26
26
|
import argparse
|
|
27
27
|
import codecs
|
|
28
28
|
import pdb
|
|
29
|
+
import re
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
BASE_URL = 'https://gdex.ucar.edu/api/'
|
|
@@ -67,17 +68,13 @@ def query(args=None):
|
|
|
67
68
|
print(json.dumps(result, indent=3))
|
|
68
69
|
return result
|
|
69
70
|
|
|
70
|
-
def
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if len(ds_num) != 7:
|
|
78
|
-
print("'" + ds_num + "' is not valid.")
|
|
79
|
-
sys.exit()
|
|
80
|
-
return ds_num
|
|
71
|
+
def validate_dsid(dsid):
|
|
72
|
+
""" Validate dsid from command line input """
|
|
73
|
+
ms = re.match(r'^([a-z]{1})(\d{3})(\d{3})$', dsid)
|
|
74
|
+
if ms:
|
|
75
|
+
return dsid
|
|
76
|
+
else:
|
|
77
|
+
raise ValueError("dataset number 'dsid' must be formatted as 'dnnnnnn'")
|
|
81
78
|
|
|
82
79
|
def get_userinfo():
|
|
83
80
|
"""Get token from command line."""
|
|
@@ -511,10 +508,11 @@ def write_control_file_template(ds, write_location='./'):
|
|
|
511
508
|
Returns:
|
|
512
509
|
dict: JSON decoded result of the query.
|
|
513
510
|
"""
|
|
511
|
+
dsid = validate_dsid(ds)
|
|
514
512
|
_json = get_control_file_template(ds)
|
|
515
513
|
control_str = _json['data']['template']
|
|
516
514
|
|
|
517
|
-
template_filename = write_location +
|
|
515
|
+
template_filename = write_location + dsid + '_control.ctl'
|
|
518
516
|
if os.path.exists(template_filename):
|
|
519
517
|
print(template_filename + " already exists.\nExiting")
|
|
520
518
|
exit(1)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{gdex_api_client-2.0.1 → gdex_api_client-2.0.3}/src/gdex_api_client.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|