NekUpload.metadata package
- class NekUpload.metadata.Identifier(id: str, id_type: IdentifierType)[source]
Bases:
objectMetadata object describing a persistent identifier associated with a person or organisation
- classmethod from_json(data: dict[str, Any]) Identifier[source]
Deserialise json object to reconstruct object
- Parameters:
cls (Type[Identifier]) – Class
data (dict[str,Any]) – JSON serialised object
- Raises:
ValueError – _description_
- Returns:
Reconstructed object
- Return type:
- get_id_type() IdentifierType[source]
Get the id type
- Returns:
Identifier type
- Return type:
- class NekUpload.metadata.IdentifierType(*values)[source]
Bases:
EnumEnum denoting persistent identifier types
- GND = 'gnd'
- ISNI = 'isni'
- ORCID = 'orcid'
- ROR = 'ror'
- class NekUpload.metadata.InvenioMetadata(title: str, publication_date: str, creators: list[InvenioUserInfo], resource_type: ResourceType = ResourceType.DATASET)[source]
Bases:
objectMetadata 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_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:
- 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]
- class NekUpload.metadata.InvenioOrgInfo(name: str)[source]
Bases:
InvenioUserInfoHolds information about an organisation in the format expected from InvenioRDM. Effectively a model for the InvenioRDM Author as an Organisation field.
- classmethod from_json(data: dict[str, Any]) InvenioOrgInfo[source]
Deserialise json serialisable object to reconstruct an object of this class.
- Parameters:
data (Dict[str,Any]) – JSON serialisable object
- Returns:
Reconstructed object
- Return type:
- class NekUpload.metadata.InvenioPersonInfo(given_name: str, family_name: str)[source]
Bases:
InvenioUserInfoHolds information about a person in the format expected from InvenioRDM. Effectively a model for the InvenioRDM Author as a Person field.
- classmethod from_json(data: dict[str, Any]) InvenioPersonInfo[source]
Deserialise json serialisable object to reconstruct an object of this class.
- Parameters:
data (Dict[str,Any]) – JSON serialisable object
- Returns:
Reconstructed object
- Return type:
- class NekUpload.metadata.InvenioUserInfo[source]
Bases:
ABCBase abstract class describing information about a user
- add_identifier(identifier: Identifier) None[source]
Add a persistent identifier related to the user
- Parameters:
identifier (Identifier) – Object describing a unique identifier
- Raises:
ValueError – _description_
- abstractmethod classmethod from_json(data: dict[str, Any]) InvenioUserInfo[source]
Deserialise json serialisable object to reconstruct an object of this class. Factory method.
- Parameters:
data (Dict[str,Any]) – JSON serialisable object
- Returns:
Object
- Return type:
- class NekUpload.metadata.InvenioUserInfoFactory[source]
Bases:
object- classmethod create_from_json(json_data: dict[str, Any]) InvenioUserInfo[source]
Create suitable object from json. Note that to figure out which object to create, “type” is used as unique identifier
- Parameters:
json_data (dict[str,Any]) – JSON serialised data
- Raises:
ValueError – _description_
- Returns:
An object of this class or subclass
- Return type:
- class NekUpload.metadata.Relations(id: str, scheme: RelationsSchemes, relation: RelationType, resource: ResourceType)[source]
Bases:
objectMetadata model for handling the Relations field in InvenioRDM. Describes any links between records with each other and/or external resources
- class NekUpload.metadata.ResourceType(*values)[source]
Bases:
Enum- DATASET = 'dataset'
- MODEL = 'model'
- PHYSICAL_OBJECT = 'physicalobject'
Submodules
- NekUpload.metadata.data_types module
- NekUpload.metadata.extractor module
- NekUpload.metadata.identifier module
- NekUpload.metadata.metadata module
InvenioMetadataInvenioMetadata.add_description()InvenioMetadata.add_geometry_domain()InvenioMetadata.add_publisher()InvenioMetadata.add_related_identifier()InvenioMetadata.add_reynolds_number()InvenioMetadata.add_solver_type()InvenioMetadata.add_version()InvenioMetadata.from_json()InvenioMetadata.get_metadata_payload()InvenioMetadata.print_ae_metadata_to_file()InvenioMetadata.to_json_serialisable()
- NekUpload.metadata.relations module
- NekUpload.metadata.user module