Datacite¶
Datacite plugin provides Package model and converters between Datacite and Data Package notations
Installation¶
Not extra dependencies are required
Usage¶
Converting a Datacite descriptor to the Data Package notation:
from dplib.plugins.datacite.models import DatacitePackage
package = DatacitePackage.from_path("data/plugins/datacite/package.json").to_dp()
print(package.to_text(format='json'))
{
"id": "https://doi.org/https://doi.org/10.1234/example-full",
"title": "Full DataCite XML Example",
"description": "XML example of all DataCite Metadata Schema v4.3 properties.",
"homepage": "https://schema.datacite.org/meta/kernel-4.3/example/datacite-example-full-v4.3.xml",
"version": "4.2",
"licenses": [
{
"path": "http://creativecommons.org/publicdomain/zero/1.0",
"title": "Creative Commons Zero v1.0 Universal"
}
],
"contributors": [
{
"title": "Miller, Elizabeth",
"role": "creator",
"organization": "DataCite"
},
{
"title": "Starr, Joan",
"role": "ProjectLeader",
"organization": "California Digital Library"
}
],
"keywords": ["000 computer science"]
}
Converting a Data Package to Datacite notation:
from dplib.models import Package
from dplib.plugins.datacite.models import Datacite
package = Datacite.from_dp(Package.from_path("data/package.json"))
print(package.to_text(format="json"))
Reference¶
dplib.plugins.datacite.models.DatacitePackage
¶
Bases: Model
Datacite Package model
Source code in dplib/plugins/datacite/models/package.py
21 22 23 24 25 26 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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
contributors: List[DataciteContributor] = []
class-attribute
instance-attribute
¶
creators: List[DataciteContributor] = []
class-attribute
instance-attribute
¶
descriptions: List[DataciteDescription] = []
class-attribute
instance-attribute
¶
identifiers: List[DataciteIdentifier] = []
class-attribute
instance-attribute
¶
language: Optional[str] = None
class-attribute
instance-attribute
¶
publicationYear: Optional[str] = None
class-attribute
instance-attribute
¶
publisher: Optional[str] = None
class-attribute
instance-attribute
¶
rightsList: List[DataciteRights] = []
class-attribute
instance-attribute
¶
schemaVersion: Optional[str] = None
class-attribute
instance-attribute
¶
subjects: List[DataciteSubject] = []
class-attribute
instance-attribute
¶
titles: List[DataciteTitle] = []
class-attribute
instance-attribute
¶
version: Optional[str] = None
class-attribute
instance-attribute
¶
from_dp(package)
classmethod
¶
Create a Datacite Package from Data Package
Parameters:
Name | Type | Description | Default |
---|---|---|---|
package |
Package
|
Data Package |
required |
Returns:
Type | Description |
---|---|
DatacitePackage
|
Datacite Package |
Source code in dplib/plugins/datacite/models/package.py
to_dp()
¶
Convert to Data Package
Returns:
Type | Description |
---|---|
Package
|
Data Package |