@@ -23,7 +23,7 @@ class DeployLogLevel(Enum):
2323 debug = 2
2424
2525
26- def __get_content_variants (distribution_str : str ) -> Optional [Dict [str , str ]]:
26+ def _get_content_variants (distribution_str : str ) -> Optional [Dict [str , str ]]:
2727 args = distribution_str .split ("|" )
2828
2929 # cv string is ALWAYS at position 1 after the URL
@@ -41,7 +41,7 @@ def __get_content_variants(distribution_str: str) -> Optional[Dict[str, str]]:
4141 return cvs
4242
4343
44- def __get_filetype_definition (
44+ def _get_filetype_definition (
4545 distribution_str : str ,
4646) -> Tuple [Optional [str ], Optional [str ]]:
4747 file_ext = None
@@ -80,9 +80,9 @@ def __get_filetype_definition(
8080 return file_ext , compression
8181
8282
83- def __get_extensions (distribution_str : str ) -> Tuple [str , str , str ]:
83+ def _get_extensions (distribution_str : str ) -> Tuple [str , str , str ]:
8484 extension_part = ""
85- format_extension , compression = __get_filetype_definition (distribution_str )
85+ format_extension , compression = _get_filetype_definition (distribution_str )
8686
8787 if format_extension is not None :
8888 # build the format extension (only append compression if not none)
@@ -119,7 +119,7 @@ def __get_extensions(distribution_str: str) -> Tuple[str, str, str]:
119119 return extension_part , format_extension , compression
120120
121121
122- def __get_file_stats (distribution_str : str ) -> Tuple [Optional [str ], Optional [int ]]:
122+ def _get_file_stats (distribution_str : str ) -> Tuple [Optional [str ], Optional [int ]]:
123123 metadata_list = distribution_str .split ("|" )[1 :]
124124 # check whether there is the shasum:length tuple separated by :
125125 if len (metadata_list ) == 0 or ":" not in metadata_list [- 1 ]:
@@ -139,7 +139,7 @@ def __get_file_stats(distribution_str: str) -> Tuple[Optional[str], Optional[int
139139 return sha256sum , content_length
140140
141141
142- def __load_file_stats (url : str ) -> Tuple [str , int ]:
142+ def _load_file_stats (url : str ) -> Tuple [str , int ]:
143143 resp = requests .get (url )
144144 if resp .status_code > 400 :
145145 raise requests .exceptions .RequestException (response = resp )
@@ -149,20 +149,20 @@ def __load_file_stats(url: str) -> Tuple[str, int]:
149149 return sha256sum , content_length
150150
151151
152- def __get_file_info (distribution_str : str ) -> Tuple [Dict [str , str ], str , str , str , int ]:
153- cvs = __get_content_variants (distribution_str )
154- extension_part , format_extension , compression = __get_extensions (distribution_str )
152+ def get_file_info (distribution_str : str ) -> Tuple [Dict [str , str ], str , str , str , int ]:
153+ cvs = _get_content_variants (distribution_str )
154+ extension_part , format_extension , compression = _get_extensions (distribution_str )
155155
156156 content_variant_part = "_" .join ([f"{ key } ={ value } " for key , value in cvs .items ()])
157157
158158 if __debug :
159159 print ("DEBUG" , distribution_str , extension_part )
160160
161- sha256sum , content_length = __get_file_stats (distribution_str )
161+ sha256sum , content_length = _get_file_stats (distribution_str )
162162
163163 if sha256sum is None or content_length is None :
164164 __url = str (distribution_str ).split ("|" )[0 ]
165- sha256sum , content_length = __load_file_stats (__url )
165+ sha256sum , content_length = _load_file_stats (__url )
166166
167167 return cvs , format_extension , compression , sha256sum , content_length
168168
@@ -200,7 +200,7 @@ def create_distribution(
200200
201201 return f"{ url } |{ meta_string } "
202202
203- def create_distributions_from_metadata (metadata : List [Dict [str , Union [str , int ]]]) -> List [str ]:
203+ def _create_distributions_from_metadata (metadata : List [Dict [str , Union [str , int ]]]) -> List [str ]:
204204 """
205205 Create distributions from metadata entries.
206206
@@ -313,7 +313,7 @@ def create_dataset(
313313 compression ,
314314 sha256sum ,
315315 content_length ,
316- ) = __get_file_info (dst_string )
316+ ) = get_file_info (dst_string )
317317
318318 if not cvs and len (distributions ) > 1 :
319319 raise BadArgumentException (
@@ -453,7 +453,7 @@ def deploy_from_metadata(
453453 Parameters
454454 ----------
455455 metadata : List[Dict[str, Union[str, int]]]
456- List of file metadata entries (see create_distributions_from_metadata )
456+ List of file metadata entries (see _create_distributions_from_metadata )
457457 version_id : str
458458 Dataset version ID in the form $DATABUS_BASE/$ACCOUNT/$GROUP/$ARTIFACT/$VERSION
459459 title : str
@@ -467,7 +467,7 @@ def deploy_from_metadata(
467467 apikey : str
468468 API key for authentication
469469 """
470- distributions = create_distributions_from_metadata (metadata )
470+ distributions = _create_distributions_from_metadata (metadata )
471471
472472 dataset = create_dataset (
473473 version_id = version_id ,
0 commit comments