isogeo_migrations_toolbelt.match.matcher module

class isogeo_migrations_toolbelt.match.matcher.Matcher(api_client: isogeo_pysdk.isogeo.Isogeo, source_workgroup_uuid: uuid.UUID = '', target_workgroup_uuid: uuid.UUID = '', query: str = '')[source]

Bases: object

Mathcher use Isogeo Python SDK to establishe matches between metadatas according to specified matching criteria. It is useful to generate matching table for metadata migration.

Parameters:
  • api_client (Isogeo) – API client authenticated to Isogeo
  • source_workgroup_uuid (str) – the uuid of source metadatas workgroup
  • target_workgroup_uuid (str) – the uuid of target metadatas workgroup
mapping_table(add_app_url: bool = True, csv_file_path: Union[str, pathlib.Path] = '')[source]

Perform the mapping table between previously loaded source and target metadatas and optionnaly write it into a csv file at the indicated location (csv_file_path)

Parameters:
  • add_app_url (bool) – to add fields for the url of the metadatas into app.isogeo.com
  • csv_file_path (str) – the path of the matching table csv file
matching_table(source_catalog_uuid: uuid.UUID = '', target_catalog_uuid: uuid.UUID = '', target_case: str = 'up', replace_tup: tuple = ('', ), missing_string: str = '', additional_string: str = '', additional_string_type: str = 'prefix', add_app_url: bool = True, csv_file_path: Union[str, pathlib.Path] = '')[source]

Perform the matching table between previously loaded source and target metadatas according to matching criterias (case, additional_string and additional_string_type) and write it into a csv file at the indicated location (csv_file_path)

Parameters:
  • source_catalog_uuid (str) – the uuid of the source metadatas catalog
  • target_catalog_uuid (str) – the uuid of the target metadatas catalog
  • target_case (str) – the case of the target metadatas name (“low” or “up”)
  • replace_tup (str) – (the string to replace, the string to replace with)
  • missing_string (str) – the string to remove from source metadatas name
  • additional_string (str) – the string added to target metadatas name
  • additional_string_type (str) – “prefix” or “suffix”
  • add_app_url (bool) – to add fields for the url of the metadatas into app.isogeo.com
  • csv_file_path (str) – the path of the matching table csv file
write_csv_file(file_path: pathlib.Path, headers: list, content: list)[source]

Write the content into specified csv file_path with headers.