diff --git a/docs/source/_ext/plugin_markup.py b/docs/source/_ext/plugin_markup.py index 6cb73f4c..d8c1d635 100644 --- a/docs/source/_ext/plugin_markup.py +++ b/docs/source/_ext/plugin_markup.py @@ -16,7 +16,7 @@ from hermes.commands.marketplace import ( SchemaOrgOrganization, - SchemaOrgSoftwarePublication, + SchemaOrgSoftwareApplication, schema_org_hermes, ) @@ -44,7 +44,7 @@ def keywordify(text: str) -> str: return re.sub(r"[^a-z]", "-", text) -def plugin_to_schema_org(plugin: Dict[str, Any]) -> SchemaOrgSoftwarePublication: +def plugin_to_schema_org(plugin: Dict[str, Any]) -> SchemaOrgSoftwareApplication: """Convert plugin metadata from the used JSON format to Schema.org. The ``plugin`` is transformed into a ``schema:SoftwareApplication``. For most @@ -63,7 +63,7 @@ def plugin_to_schema_org(plugin: Dict[str, Any]) -> SchemaOrgSoftwarePublication harvested_files = plugin.get("harvested_files", []) keywords += [f"hermes-harvest-{keywordify(file)}" for file in harvested_files] - return SchemaOrgSoftwarePublication( + return SchemaOrgSoftwareApplication( name=plugin.get("name"), url=plugin.get("repository_url"), install_url=plugin.get("pypi_url"), diff --git a/src/hermes/commands/marketplace.py b/src/hermes/commands/marketplace.py index 5f3d9080..52648bb1 100644 --- a/src/hermes/commands/marketplace.py +++ b/src/hermes/commands/marketplace.py @@ -46,8 +46,8 @@ class SchemaOrgOrganization(SchemaOrgModel): name: str -class SchemaOrgSoftwarePublication(SchemaOrgModel): - """Validation and serialization of ``schema:SoftwarePublication``. +class SchemaOrgSoftwareApplication(SchemaOrgModel): + """Validation and serialization of ``schema:SoftwareApplication``. This model does not incorporate all possible fields and is meant to be used merely for the purposes of the Hermes marketplace. @@ -60,11 +60,11 @@ class SchemaOrgSoftwarePublication(SchemaOrgModel): install_url: Optional[str] = None abstract: Optional[str] = None author: Optional[SchemaOrgOrganization] = None - is_part_of: Optional["SchemaOrgSoftwarePublication"] = None + is_part_of: Optional["SchemaOrgSoftwareApplication"] = None keywords: List["str"] = None -schema_org_hermes = SchemaOrgSoftwarePublication(id_=hermes_doi, name="hermes") +schema_org_hermes = SchemaOrgSoftwareApplication(id_=hermes_doi, name="hermes") class PluginMarketPlaceParser(HTMLParser): @@ -73,7 +73,7 @@ class PluginMarketPlaceParser(HTMLParser): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.is_json_ld: bool = False - self.plugins: List[SchemaOrgSoftwarePublication] = [] + self.plugins: List[SchemaOrgSoftwareApplication] = [] def handle_starttag(self, tag, attrs): if tag == "script" and ("type", "application/ld+json") in attrs: @@ -84,7 +84,7 @@ def handle_endtag(self, tag): def handle_data(self, data): if self.is_json_ld: - plugin = SchemaOrgSoftwarePublication.model_validate_json(data) + plugin = SchemaOrgSoftwareApplication.model_validate_json(data) self.plugins.append(plugin)