NekUpload.metadata.metadata module

class NekUpload.metadata.metadata.InvenioMetadata(title: str, publication_date: str, creators: list[InvenioUserInfo], resource_type: ResourceType = ResourceType.DATASET)[source]

Bases: object

Metadata model for handling metadata as prescribed in InvenioRDM. Uses a builder OOP style to allow clients to enhance the metadata description.

add_description(description: str) None[source]

Add a description of the record to be uploaded

Parameters:

description (str) – Description

add_geometry_domain(min_coord: tuple[int, int, int], max_coord: tuple[int, int, int])[source]

Add domian of goemetyr

Parameters:
  • min_coord (tuple[int,int,int]) – _description_

  • max_coord (tuple[int,int,int]) – _description_

add_publisher(publisher: str = 'InvenioRDM') None[source]

Add publisher

Parameters:

publisher (str, optional) – Add publisher name. Defaults to “InvenioRDM”.

Add related persistent identifiers

Parameters:

relation (Relations) – A related identifier

add_reynolds_number(reynolds: float) None[source]

Add reynolds number of flow

Parameters:

reynolds (float) – _description_

add_solver_type(solver_type: str)[source]
add_version(version: str) None[source]

Add the version number (of the software or dataset). Semantic versioning is recommended.

Parameters:

version (str) – Version number

classmethod from_json(data: dict[str, Any]) InvenioMetadata[source]

Reconstruct object from JSON serialisation

Parameters:

data (dict[str,Any]) – Serialised JSON data

Returns:

Reconstructed object

Return type:

InvenioMetadata

get_metadata_payload() dict[str, Any][source]

Get the metadata payload formatted in way InvenioRDM expects

Returns:

Metadata json payload

Return type:

dict[str,Any]

print_ae_metadata_to_file(target_directory: str) str[source]

Print AE Datastore specific metadata to file

Parameters:

target_directory (str) – directory to store file

Returns:

Path to created file

Return type:

str

to_json_serialisable() dict[str, Any][source]

Serialise the object as JSON

Returns:

Serialised json object

Return type:

dict[str,Any]