cdapython 2.1.0__tar.gz → 2.2.0__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.
- {cdapython-2.1.0 → cdapython-2.2.0}/CHANGELOG.md +2 -0
- {cdapython-2.1.0 → cdapython-2.2.0}/PKG-INFO +2 -2
- {cdapython-2.1.0 → cdapython-2.2.0}/cdapython/__init__.py +1 -2
- {cdapython-2.1.0 → cdapython-2.2.0}/cdapython/discover.py +61 -1
- cdapython-2.2.0/cdapython/get_data.py +2216 -0
- {cdapython-2.1.0 → cdapython-2.2.0}/cdapython/summarize.py +882 -254
- {cdapython-2.1.0 → cdapython-2.2.0}/cdapython/validation.py +15 -1
- {cdapython-2.1.0 → cdapython-2.2.0}/pyproject.toml +2 -2
- cdapython-2.1.0/cdapython/application_utilities.py +0 -54
- cdapython-2.1.0/cdapython/get_data.py +0 -1227
- {cdapython-2.1.0 → cdapython-2.2.0}/LICENSE +0 -0
- {cdapython-2.1.0 → cdapython-2.2.0}/README.md +0 -0
- {cdapython-2.1.0 → cdapython-2.2.0}/cdapython/config/__init__.py +0 -0
- {cdapython-2.1.0 → cdapython-2.2.0}/cdapython/config/logger_default_config.yml +0 -0
- {cdapython-2.1.0 → cdapython-2.2.0}/cdapython/logging_wrappers.py +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
2026-08-25: 2.2.0: add support for harmonized controlled-vocabulary metadata retrieval (slims, synonyms, containing terms); see help text for the `add_extras` flag in the `get\_data()` and `summarize()` functions
|
|
2
|
+
|
|
1
3
|
2026-04-07: 2.1.0: add `search_terms` support; obsolesce `disease_slims` POC in deference to upcoming full version
|
|
2
4
|
|
|
3
5
|
2025-12-09: 2.0.14: add sort postproc to POC `disease_slims` return column
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cdapython
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: NCI CRDC CDA front-end user interface library
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Python: >=3.9,<4.0
|
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
14
14
|
Requires-Dist: cda-client (>=2.1.0)
|
|
15
15
|
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
|
16
16
|
Requires-Dist: pyyaml (>=6.0.0)
|
|
17
|
-
Requires-Dist: tabulate (>=0.
|
|
17
|
+
Requires-Dist: tabulate (>=0.10.0)
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
|
|
20
20
|
# cdapython
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
from cdapython.
|
|
2
|
-
from cdapython.discover import cda_functions, column_values, columns, release_metadata, tables
|
|
1
|
+
from cdapython.discover import cda_extra_metadata_columns, cda_functions, column_values, columns, get_api_url, release_metadata, set_api_url, tables
|
|
3
2
|
from cdapython.summarize import expand_file_results, expand_subject_results, intersect_file_results, intersect_subject_results, summarize_files, summarize_subjects
|
|
4
3
|
from cdapython.get_data import get_file_data, get_subject_data
|
|
5
4
|
|
|
@@ -8,7 +8,6 @@ import cda_client.api.columns.columns_endpoint_columns_get
|
|
|
8
8
|
import cda_client.api.release_metadata.release_metadata_endpoint_release_metadata_get
|
|
9
9
|
import cda_client.api.column_values.column_values_endpoint_column_values_column_post
|
|
10
10
|
|
|
11
|
-
from cdapython.application_utilities import get_api_url
|
|
12
11
|
from cda_client.errors import UnexpectedStatus
|
|
13
12
|
from cdapython.logging_wrappers import get_logger
|
|
14
13
|
|
|
@@ -22,6 +21,47 @@ from cdapython.logging_wrappers import get_logger
|
|
|
22
21
|
#############################################################################################################################
|
|
23
22
|
|
|
24
23
|
|
|
24
|
+
#############################################################################################################################
|
|
25
|
+
#
|
|
26
|
+
# get_api_url(): Return the current system URL for the CDA REST API.
|
|
27
|
+
#
|
|
28
|
+
#############################################################################################################################
|
|
29
|
+
|
|
30
|
+
def get_api_url():
|
|
31
|
+
"""
|
|
32
|
+
Return the currently-set URL pointing to the CDA REST API.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
# System default.
|
|
36
|
+
default_api_url = 'https://cda.datacommons.cancer.gov'
|
|
37
|
+
|
|
38
|
+
# Has the user set a non-default URL?
|
|
39
|
+
local_api_url = os.environ.get( '__CDA_API_URL' )
|
|
40
|
+
|
|
41
|
+
if local_api_url is not None and len( local_api_url ) > 0:
|
|
42
|
+
return local_api_url
|
|
43
|
+
else:
|
|
44
|
+
return default_api_url
|
|
45
|
+
|
|
46
|
+
#############################################################################################################################
|
|
47
|
+
#
|
|
48
|
+
# set_api_url(): Set the current system URL for the CDA REST API.
|
|
49
|
+
#
|
|
50
|
+
#############################################################################################################################
|
|
51
|
+
|
|
52
|
+
def set_api_url( new_api_url ):
|
|
53
|
+
"""
|
|
54
|
+
Set the current system URL for the CDA REST API.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
# Do some basic sanity checking.
|
|
58
|
+
if re.search( r'^https*:\/\/', new_api_url ) is None:
|
|
59
|
+
raise RuntimeError( 'set_api_url(): Only HTTP and HTTPS URLs are allowed.' )
|
|
60
|
+
elif len( new_api_url ) > 100:
|
|
61
|
+
raise RuntimeError( 'set_api_url(): Whatever that was, it wasn\'t the URL of the CDA REST API.' )
|
|
62
|
+
|
|
63
|
+
os.environ['__CDA_API_URL'] = new_api_url
|
|
64
|
+
|
|
25
65
|
#############################################################################################################################
|
|
26
66
|
#
|
|
27
67
|
# cda_functions(): Return a list of user-facing cdapython functions useful for both scripting and interactive data sessions.
|
|
@@ -62,6 +102,7 @@ def cda_functions():
|
|
|
62
102
|
'disable_file_logging',
|
|
63
103
|
'get_api_url',
|
|
64
104
|
'set_api_url',
|
|
105
|
+
'cda_extra_metadata_columns',
|
|
65
106
|
'cda_functions'
|
|
66
107
|
]
|
|
67
108
|
|
|
@@ -71,6 +112,24 @@ def cda_functions():
|
|
|
71
112
|
#
|
|
72
113
|
#############################################################################################################################
|
|
73
114
|
|
|
115
|
+
#############################################################################################################################
|
|
116
|
+
#
|
|
117
|
+
# cda_extra_metadata_columns(): Return a list of available metadata annotations that provide context for some harmonized CDA
|
|
118
|
+
# fields.
|
|
119
|
+
#
|
|
120
|
+
#############################################################################################################################
|
|
121
|
+
|
|
122
|
+
def cda_extra_metadata_columns():
|
|
123
|
+
# extra_metadata_columns is enumerated by cda_extra_metadata_columns() in desired column-display order for return_data_as='':
|
|
124
|
+
extra_metadata_columns = [ 'synonym_terms', 'slim_terms', 'containing_terms' ]
|
|
125
|
+
return extra_metadata_columns
|
|
126
|
+
|
|
127
|
+
#############################################################################################################################
|
|
128
|
+
#
|
|
129
|
+
# END cda_extra_metadata_columns()
|
|
130
|
+
#
|
|
131
|
+
#############################################################################################################################
|
|
132
|
+
|
|
74
133
|
#############################################################################################################################
|
|
75
134
|
#
|
|
76
135
|
# tables(): Return a list of all searchable CDA data tables.
|
|
@@ -876,6 +935,7 @@ def column_values(
|
|
|
876
935
|
include_external_refs=None,
|
|
877
936
|
return_data_as=return_data_as,
|
|
878
937
|
output_file=output_file,
|
|
938
|
+
add_extras=None,
|
|
879
939
|
sort_by=sort_by,
|
|
880
940
|
log=log
|
|
881
941
|
)
|