1.1.1.1.2. tds2stac.analysers.nested_collections module#

class tds2stac.analysers.nested_collections.NestedCollectionInspector(main_catalog_url: str, nested_number: int | None = None, logger_properties: dict = {}, requests_properties: dict = {})[source]#

Bases: object

This class will generate Collection IDs, Titles and their corresponding URLs for a presumed nested number originating from the Recognizer class in TDS. Only works for nested scenarios number 1,2,3,8 and 9 in Recognizer class. The output will be a list of the tuples: (Root collection URL, Collection ID, Collection Title, corresponding subset URLs)

Parameters:
  • main_catalog_url (str) – The URL of the TDS catalog

  • nested_number (int, optional) – Number of depth for nested datasets

  • logger_properties (dict, optional) – A dictionary for logger properties

  • requests_properties (dict, optional) – A dictionary for requests properties

all_nested_dict: dict#
all_urls: list#
aslist()[source]#

A function for returning the list of tuples

corresponding_urls_ids: list | None#
depth_addresses: list#
end_point_url_extractor_dict(d: dict)[source]#

A function for extracting the end point URLs of a nested dictionary.

Parameters:

d (dict) – A nested dictionary

end_point_url_extractor_list(list_: list)[source]#

A function for extracting the end point URLs of a nested list.

Parameters:

list (list) – A nested list

final_collections_details_returner(url: str)[source]#

A function for returning the URLs of input URL in First and Third cases in TDS

Parameters:

url (str) – The URL of the TDS catalog

layer_dict: dict#
logger_properties: dict#

A dictionary for logger properties. For more information see Logger

main_catalog_url: str#

The URL of the TDS catalog

n_level(d: dict, layer: int)[source]#

For decoding the generator object of to_level function. https://stackoverflow.com/a/68228562

Parameters:
  • d (dict) – A nested dictionary

  • layer (int) – The depth of the dictionary

nested_dict_returner(url: str, dict: dict)[source]#

A function for getting the nested dictionary of a given URL.

Parameters:
  • url (str) – The URL of the TDS catalog

  • dict (dict) – A nested dictionary

nested_number: int | None#

Number of depth for nested datasets

requests_properties: dict#

To obtain additional information on this topic, refer to the requests_properties. The default value is an empty dictionary.

to_level(d: dict, layer: int)[source]#

A function for getting the a dictionary in a given depth. https://stackoverflow.com/a/68228562

Parameters:
  • d (dict) – A nested dictionary

  • layer (int) – The depth of the dictionary