pid_record_entry
PIDRecordEntry ¶
Bases: dict
Represents a PID record entry. For more information on the PID record format, see the documentation of the Typed PID Maker (https://kit-data-manager.github.io/webpage/typed-pid-maker/openapi.html). A PID record entry consists of a key, a value, and optionally a name.
Attributes: key:str The key of the entry value:str The value of the entry name:str The name of the entry (optional)
Source code in src/nmr_FAIR_DOs/domain/pid_record_entry.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
__init__ ¶
__init__(key: str, value: str | dict, name: str = None)
Creates a PID record entry
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
str The key of the entry |
required |
value |
str | dict
|
str The value of the entry |
required |
name |
str
|
str The name of the entry (optional) |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If the key is None or the value is None |
Source code in src/nmr_FAIR_DOs/domain/pid_record_entry.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
__getitem__ ¶
__getitem__(item)
This method is called to get the value of the given key. This enables the use of the dictionary syntax to access the key, value, and name of the PID record entry.
Source code in src/nmr_FAIR_DOs/domain/pid_record_entry.py
83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
toJSON ¶
toJSON()
Exports the PID record entry as JSON
Returns: dict: The PID record entry as JSON
Source code in src/nmr_FAIR_DOs/domain/pid_record_entry.py
108 109 110 111 112 113 114 115 116 117 118 119 120 |
|