hermes.utils
Attributes
Fix "concept" DOI that always refers to the newest version. |
|
Functions
|
Extracts the keys and values from the project.urls section in distribution package metadata |
|
File type detection for non-standardised formats. |
|
Masks potentially sensitive values in the 'options' argument |
Module Contents
- hermes.utils.retrieve_project_urls(metadata_urls: list[str]) dict[str, str]
Extracts the keys and values from the project.urls section in distribution package metadata and converts them into a dictionary.
- Parameters:
metadata_urls – The list of urls to extract from (from distribution metadata)
- Returns:
A dictionary mapping URL names to URLs
- hermes.utils.hermes_concept_doi = '10.5281/zenodo.13221383'
Fix “concept” DOI that always refers to the newest version.
- hermes.utils.guess_file_type(path: pathlib.Path)
File type detection for non-standardised formats.
Custom detection for file types not yet supported by Python’s
guess_typefunction.
- hermes.utils.mask_options_values(args: argparse.Namespace) argparse.Namespace
Masks potentially sensitive values in the ‘options’ argument in the passed argparse.Namespace.
The main use case for this is preventing potentially sensitive data/secrets being included in raw args logging.
- Parameters:
args – The argparse.Namespace to mask.
- Returns:
A copy of the namespace with masked sensitive values.