hermes.utils

Attributes

Functions

retrieve_project_urls(→ dict[str, str])

Extracts the keys and values from the project.urls section in distribution package metadata

guess_file_type(path)

File type detection for non-standardised formats.

mask_options_values(→ argparse.Namespace)

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_metadata
hermes.utils.hermes_name
hermes.utils.hermes_version
hermes.utils.hermes_urls
hermes.utils.hermes_homepage
hermes.utils.hermes_doi = '10.5281/zenodo.14931650'
hermes.utils.hermes_doi_url = 'https://doi.org/10.5281/zenodo.14931650'
hermes.utils.hermes_concept_doi = '10.5281/zenodo.13221383'

Fix “concept” DOI that always refers to the newest version.

hermes.utils.hermes_user_agent = 'Uninferable/Uninferable (Uninferable)'
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_type function.

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.