utils submodule

almasru.utils.analyse_records(mms_ids: List[str], filepath: str | None = None) DataFrame

Analyse records and check related records

Use a list of MMS ID to analyse the records and return a pandas.DataFrame with the results.

Main difference with check_removable_records() is that this function will check all parameters.

Parameters:
  • mms_ids – list of MMS ID to analyse

  • filepath – Optional string with a path to an Excel file to save automatically each checked record

Returns:

pandas.DataFrame containing the results of the analysis

almasru.utils.check_removable_records(mms_ids: List[str], filepath: str | None = None) DataFrame

Check removable records for a list of MMS ID

Not all parameters are always checked. The system stop to check once one parameter is found preventing the deletion.

Parameters:
  • mms_ids – List of MMS ID of records to check through SRU

  • filepath – Optional string with a path to an Excel file to save automatically each checked record

Returns:

pandas.DataFrame containing the results of the analysis

almasru.utils.remove_ns(data: Element) Element

Remove namespace from XML data

Parameters:

dataetree.Element object with xml data

Returns:

etree.Element without namespace information

almasru.utils.roman_to_int(roman_number: str) int | None

Transform a roman number to an integer

Parameters:

roman_number – roman number

Returns:

int value of the number or None if the number is not valid