commonmeta-py 0.22__py3-none-any.whl → 0.24__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. commonmeta/__init__.py +96 -0
  2. commonmeta/api_utils.py +77 -0
  3. commonmeta/author_utils.py +260 -0
  4. commonmeta/base_utils.py +121 -0
  5. commonmeta/cli.py +200 -0
  6. commonmeta/constants.py +587 -0
  7. commonmeta/crossref_utils.py +575 -0
  8. commonmeta/date_utils.py +193 -0
  9. commonmeta/doi_utils.py +273 -0
  10. commonmeta/metadata.py +320 -0
  11. commonmeta/readers/__init__.py +1 -0
  12. commonmeta/readers/bibtex_reader.py +0 -0
  13. commonmeta/readers/cff_reader.py +199 -0
  14. commonmeta/readers/codemeta_reader.py +112 -0
  15. commonmeta/readers/commonmeta_reader.py +13 -0
  16. commonmeta/readers/crossref_reader.py +409 -0
  17. commonmeta/readers/crossref_xml_reader.py +505 -0
  18. commonmeta/readers/csl_reader.py +98 -0
  19. commonmeta/readers/datacite_reader.py +390 -0
  20. commonmeta/readers/datacite_xml_reader.py +359 -0
  21. commonmeta/readers/inveniordm_reader.py +218 -0
  22. commonmeta/readers/json_feed_reader.py +420 -0
  23. commonmeta/readers/kbase_reader.py +205 -0
  24. commonmeta/readers/ris_reader.py +103 -0
  25. commonmeta/readers/schema_org_reader.py +506 -0
  26. commonmeta/resources/cff_v1.2.0.json +1827 -0
  27. commonmeta/resources/commonmeta_v0.12.json +601 -0
  28. commonmeta/resources/commonmeta_v0.13.json +559 -0
  29. commonmeta/resources/commonmeta_v0.14.json +573 -0
  30. commonmeta/resources/crossref/AccessIndicators.xsd +47 -0
  31. commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3-elements.xsd +10130 -0
  32. commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3.xsd +48 -0
  33. commonmeta/resources/crossref/JATS-journalpublishing1-elements.xsd +8705 -0
  34. commonmeta/resources/crossref/JATS-journalpublishing1-mathml3-elements.xsd +8608 -0
  35. commonmeta/resources/crossref/JATS-journalpublishing1-mathml3.xsd +49 -0
  36. commonmeta/resources/crossref/JATS-journalpublishing1.xsd +6176 -0
  37. commonmeta/resources/crossref/clinicaltrials.xsd +61 -0
  38. commonmeta/resources/crossref/common5.3.1.xsd +1538 -0
  39. commonmeta/resources/crossref/crossref5.3.1.xsd +1949 -0
  40. commonmeta/resources/crossref/crossref_query_output3.0.xsd +1097 -0
  41. commonmeta/resources/crossref/fundref.xsd +49 -0
  42. commonmeta/resources/crossref/module-ali.xsd +39 -0
  43. commonmeta/resources/crossref/relations.xsd +444 -0
  44. commonmeta/resources/crossref-v0.2.json +60 -0
  45. commonmeta/resources/csl-data.json +538 -0
  46. commonmeta/resources/datacite-v4.5.json +829 -0
  47. commonmeta/resources/datacite-v4.5pr.json +608 -0
  48. commonmeta/resources/ietf-bcp-47.json +3025 -0
  49. commonmeta/resources/iso-8601.json +3182 -0
  50. commonmeta/resources/spdx/licenses.json +4851 -0
  51. commonmeta/resources/spdx-schema..json +903 -0
  52. commonmeta/resources/styles/apa.csl +1697 -0
  53. commonmeta/resources/styles/chicago-author-date.csl +684 -0
  54. commonmeta/resources/styles/harvard-cite-them-right.csl +321 -0
  55. commonmeta/resources/styles/ieee.csl +468 -0
  56. commonmeta/resources/styles/modern-language-association.csl +341 -0
  57. commonmeta/resources/styles/vancouver.csl +376 -0
  58. commonmeta/schema_utils.py +27 -0
  59. commonmeta/translators.py +47 -0
  60. commonmeta/utils.py +1108 -0
  61. commonmeta/writers/__init__.py +1 -0
  62. commonmeta/writers/bibtex_writer.py +149 -0
  63. commonmeta/writers/citation_writer.py +70 -0
  64. commonmeta/writers/commonmeta_writer.py +68 -0
  65. commonmeta/writers/crossref_xml_writer.py +17 -0
  66. commonmeta/writers/csl_writer.py +79 -0
  67. commonmeta/writers/datacite_writer.py +193 -0
  68. commonmeta/writers/inveniordm_writer.py +94 -0
  69. commonmeta/writers/ris_writer.py +58 -0
  70. commonmeta/writers/schema_org_writer.py +146 -0
  71. {commonmeta_py-0.22.dist-info → commonmeta_py-0.24.dist-info}/METADATA +56 -45
  72. commonmeta_py-0.24.dist-info/RECORD +75 -0
  73. {commonmeta_py-0.22.dist-info → commonmeta_py-0.24.dist-info}/WHEEL +1 -1
  74. commonmeta_py-0.24.dist-info/entry_points.txt +3 -0
  75. commonmeta_py/__init__.py +0 -2
  76. commonmeta_py-0.22.dist-info/RECORD +0 -5
  77. {commonmeta_py-0.22.dist-info/licenses → commonmeta_py-0.24.dist-info}/LICENSE +0 -0
@@ -0,0 +1,601 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://commonmeta.org/commonmeta_v0.12.json",
4
+ "title": "Commonmeta v0.12",
5
+ "description": "JSON representation of the Commonmeta schema.",
6
+ "additionalProperties": false,
7
+ "definitions": {
8
+ "affiliations": {
9
+ "type": "array",
10
+ "items": {
11
+ "type": "object",
12
+ "properties": {
13
+ "id": { "type": "string", "format": "uri" },
14
+ "name": { "type": "string" }
15
+ },
16
+ "anyOf": [
17
+ {
18
+ "required": ["id"]
19
+ },
20
+ {
21
+ "required": ["name"]
22
+ }
23
+ ]
24
+ },
25
+ "uniqueItems": true
26
+ },
27
+ "contributorRole": {
28
+ "description": "The type of contribution made by a contributor",
29
+ "enum": [
30
+ "Author",
31
+ "Editor",
32
+ "Chair",
33
+ "Reviewer",
34
+ "ReviewAssistant",
35
+ "StatsReviewer",
36
+ "ReviewerExternal",
37
+ "Reader",
38
+ "Translator",
39
+ "ContactPerson",
40
+ "DataCollector",
41
+ "DataManager",
42
+ "Distributor",
43
+ "HostingInstitution",
44
+ "Producer",
45
+ "ProjectLeader",
46
+ "ProjectManager",
47
+ "ProjectMember",
48
+ "RegistrationAgency",
49
+ "RegistrationAuthority",
50
+ "RelatedPerson",
51
+ "ResearchGroup",
52
+ "RightsHolder",
53
+ "Researcher",
54
+ "Sponsor",
55
+ "WorkPackageLeader",
56
+ "Conceptualization",
57
+ "DataCuration",
58
+ "FormalAnalysis",
59
+ "FundingAcquisition",
60
+ "Investigation",
61
+ "Methodology",
62
+ "ProjectAdministration",
63
+ "Resources",
64
+ "Software",
65
+ "Supervision",
66
+ "Validation",
67
+ "Visualization",
68
+ "WritingOriginalDraft",
69
+ "WritingReviewEditing",
70
+ "Maintainer",
71
+ "Other"
72
+ ],
73
+ "type": "string"
74
+ },
75
+ "latitude": {
76
+ "type": "number",
77
+ "minimum": -90,
78
+ "maximum": 90
79
+ },
80
+ "longitude": {
81
+ "type": "number",
82
+ "minimum": -180,
83
+ "maximum": 180
84
+ },
85
+ "geoLocationPoint": {
86
+ "type": "object",
87
+ "properties": {
88
+ "pointLongitude": { "$ref": "#/definitions/longitude" },
89
+ "pointLatitude": { "$ref": "#/definitions/latitude" }
90
+ },
91
+ "required": ["pointLongitude", "pointLatitude"]
92
+ }
93
+ },
94
+ "type": "object",
95
+ "properties": {
96
+ "id": {
97
+ "description": "The unique identifier for the resource.",
98
+ "type": "string",
99
+ "format": "uri",
100
+ "pattern": "^https?://"
101
+ },
102
+ "type": {
103
+ "description": "The type of the resource.",
104
+ "enum": [
105
+ "Article",
106
+ "Audiovisual",
107
+ "BookChapter",
108
+ "BookPart",
109
+ "BookSection",
110
+ "BookSeries",
111
+ "BookSet",
112
+ "Book",
113
+ "Collection",
114
+ "Component",
115
+ "Database",
116
+ "Dataset",
117
+ "Dissertation",
118
+ "Document",
119
+ "Entry",
120
+ "Grant",
121
+ "Image",
122
+ "Instrument",
123
+ "JournalArticle",
124
+ "JournalIssue",
125
+ "JournalVolume",
126
+ "Journal",
127
+ "PeerReview",
128
+ "PhysicalObject",
129
+ "Presentation",
130
+ "ProceedingsArticle",
131
+ "ProceedingsSeries",
132
+ "Proceedings",
133
+ "ReportComponent",
134
+ "ReportSeries",
135
+ "Report",
136
+ "Software",
137
+ "Standard",
138
+ "StudyRegistration",
139
+ "WebPage",
140
+ "Other"
141
+ ]
142
+ },
143
+ "additional_type": {
144
+ "description": "The additional type of the resource.",
145
+ "type": "string"
146
+ },
147
+
148
+ "url": {
149
+ "description": "The URL of the resource.",
150
+ "type": "string",
151
+ "format": "uri"
152
+ },
153
+ "contributors": {
154
+ "description": "The contributors to the resource.",
155
+ "type": "array",
156
+ "items": {
157
+ "type": "object",
158
+ "properties": {
159
+ "id": {
160
+ "description": "The unique identifier for the contributor.",
161
+ "type": "string",
162
+ "format": "uri"
163
+ },
164
+ "type": {
165
+ "description": "The type of the contributor.",
166
+ "type": "string",
167
+ "enum": ["Organization", "Person"]
168
+ },
169
+ "contributorRoles": {
170
+ "description": "List of roles assumed by the contributor when working on the resource.",
171
+ "items": {
172
+ "$ref": "#/definitions/contributorRole"
173
+ },
174
+ "type": "array",
175
+ "uniqueItems": true
176
+ },
177
+ "name": {
178
+ "description": "The name of the contributor.",
179
+ "type": "string"
180
+ },
181
+ "givenName": {
182
+ "description": "The given name of the contributor.",
183
+ "type": "string"
184
+ },
185
+ "familyName": {
186
+ "description": "The family name of the contributor.",
187
+ "type": "string"
188
+ },
189
+ "affiliation": { "$ref": "#/definitions/affiliations" }
190
+ },
191
+ "anyOf": [
192
+ {
193
+ "required": ["familyName"]
194
+ },
195
+ {
196
+ "required": ["name"]
197
+ }
198
+ ],
199
+ "required": ["type", "contributorRoles"]
200
+ },
201
+ "minItems": 1,
202
+ "uniqueItems": true
203
+ },
204
+ "publisher": {
205
+ "description": "The publisher of the resource.",
206
+ "type": "object",
207
+ "properties": {
208
+ "id": {
209
+ "description": "The identifier for the publisher.",
210
+ "type": "string",
211
+ "format": "uri"
212
+ },
213
+ "name": {
214
+ "description": "The name of the publisher.",
215
+ "type": "string"
216
+ }
217
+ },
218
+ "required": ["name"]
219
+ },
220
+ "date": {
221
+ "description": "The dates for the resource.",
222
+ "$comment": "The date fields are not required. Dates should be formatted as ISO 8601 dates.",
223
+ "type": "object",
224
+ "properties": {
225
+ "created": {
226
+ "description": "The date the resource was created.",
227
+ "type": "string"
228
+ },
229
+ "submitted": {
230
+ "description": "The date the resource was submitted.",
231
+ "type": "string"
232
+ },
233
+ "accepted": {
234
+ "description": "The date the resource was accepted.",
235
+ "type": "string"
236
+ },
237
+ "published": {
238
+ "description": "The date the resource was published.",
239
+ "type": "string"
240
+ },
241
+ "updated": {
242
+ "description": "The date the resource was updated.",
243
+ "type": "string"
244
+ },
245
+ "accessed": {
246
+ "description": "The date the resource was accessed.",
247
+ "type": "string"
248
+ },
249
+ "available": {
250
+ "description": "The date the resource was made available.",
251
+ "type": "string"
252
+ },
253
+ "withdrawn": {
254
+ "description": "The date the resource was withdrawn.",
255
+ "type": "string"
256
+ }
257
+ }
258
+ },
259
+ "titles": {
260
+ "description": "The titles of the resource.",
261
+ "type": "array",
262
+ "items": {
263
+ "type": "object",
264
+ "properties": {
265
+ "title": {
266
+ "description": "The title of the resource.",
267
+ "type": "string"
268
+ },
269
+ "type": {
270
+ "description": "The type of the title.",
271
+ "type": "string",
272
+ "enum": ["AlternativeTitle", "Subtitle", "TranslatedTitle"]
273
+ },
274
+ "language": {
275
+ "description": "The language of the title. Use one of the language codes from the IETF BCP 47 standard.",
276
+ "type": "string"
277
+ }
278
+ },
279
+ "required": ["title"]
280
+ }
281
+ },
282
+ "container": {
283
+ "description": "The container of the resource.",
284
+ "type": "object",
285
+ "properties": {
286
+ "identifier": {
287
+ "description": "The identifier for the container.",
288
+ "type": "string"
289
+ },
290
+ "identifierType": {
291
+ "description": "The identifierType for the container.",
292
+ "type": "string"
293
+ },
294
+ "type": {
295
+ "description": "The type of the container.",
296
+ "type": "string",
297
+ "enum": [
298
+ "Book",
299
+ "BookSeries",
300
+ "Journal",
301
+ "Proceedings",
302
+ "ProceedingsSeries",
303
+ "Repository",
304
+ "DataRepository",
305
+ "Periodical",
306
+ "Series"
307
+ ]
308
+ },
309
+ "title": {
310
+ "description": "The title of the container.",
311
+ "type": "string"
312
+ },
313
+ "firstPage": {
314
+ "description": "The first page of the resource.",
315
+ "type": "string"
316
+ },
317
+ "lastPage": {
318
+ "description": "The last page of the resource.",
319
+ "type": "string"
320
+ },
321
+ "volume": {
322
+ "description": "The volume of the resource.",
323
+ "type": "string"
324
+ },
325
+ "issue": {
326
+ "description": "The issue of the resource.",
327
+ "type": "string"
328
+ }
329
+ }
330
+ },
331
+ "subjects": {
332
+ "type": "array",
333
+ "items": {
334
+ "type": "object",
335
+ "properties": {
336
+ "subject": { "type": "string" }
337
+ },
338
+ "required": ["subject"]
339
+ },
340
+ "uniqueItems": true
341
+ },
342
+ "sizes": {
343
+ "description": "The sizes of the resource.",
344
+ "type": "array",
345
+ "items": {
346
+ "type": "string"
347
+ },
348
+ "uniqueItems": true
349
+ },
350
+ "formats": {
351
+ "description": "The formats of the resource.",
352
+ "type": "array",
353
+ "items": {
354
+ "type": "string"
355
+ },
356
+ "uniqueItems": true
357
+ },
358
+ "language": {
359
+ "description": "The language of the resource. Use one of the language codes from the IETF BCP 47 standard.",
360
+ "type": "string"
361
+ },
362
+ "license": {
363
+ "description": "The license for the resource. Use one of the SPDX license identifiers.",
364
+ "type": "object",
365
+ "properties": {
366
+ "id": { "type": "string" },
367
+ "url": { "type": "string", "format": "uri" }
368
+ }
369
+ },
370
+ "version": {
371
+ "description": "The version of the resource.",
372
+ "type": "string"
373
+ },
374
+ "references": {
375
+ "type": "array",
376
+ "items": {
377
+ "type": "object",
378
+ "properties": {
379
+ "key": { "type": "string" },
380
+ "doi": { "type": "string" },
381
+ "contributor": { "type": "string" },
382
+ "title": { "type": "string" },
383
+ "publisher": { "type": "string" },
384
+ "publicationYear": { "type": "string" },
385
+ "volume": { "type": "string" },
386
+ "issue": { "type": "string" },
387
+ "firstPage": { "type": "string" },
388
+ "lastPage": { "type": "string" },
389
+ "containerTitle": { "type": "string" },
390
+ "edition": { "type": "string" },
391
+ "unstructured": { "type": "string" }
392
+ },
393
+ "required": ["key"]
394
+ },
395
+ "uniqueItems": true
396
+ },
397
+ "relations": {
398
+ "description": "Other resolvable persistent unique IDs related to the resource.",
399
+ "type": "array",
400
+ "items": {
401
+ "type": "object",
402
+ "properties": {
403
+ "id": {
404
+ "type": "string",
405
+ "format": "uri"
406
+ },
407
+ "type": {
408
+ "type": "string",
409
+ "enum": [
410
+ "IsNewVersionOf",
411
+ "IsPreviousVersionOf",
412
+ "IsVersionOf",
413
+ "HasVersion",
414
+ "IsPartOf",
415
+ "HasPart",
416
+ "IsVariantFormOf",
417
+ "IsOriginalFormOf",
418
+ "IsIdenticalTo",
419
+ "IsTranslationOf",
420
+ "HasTranslation",
421
+ "IsReviewedBy",
422
+ "Reviews",
423
+ "HasReview",
424
+ "IsPreprintOf",
425
+ "HasPreprint",
426
+ "IsSupplementTo",
427
+ "IsSupplementedBy"
428
+ ]
429
+ }
430
+ },
431
+ "required": ["id", "type"]
432
+ },
433
+ "uniqueItems": true
434
+ },
435
+ "funding_references": {
436
+ "description": "The funding references for the resource.",
437
+ "type": "array",
438
+ "items": {
439
+ "type": "object",
440
+ "properties": {
441
+ "funderIdentifier": { "type": "string" },
442
+ "funderIdentifierType": {
443
+ "type": "string",
444
+ "enum": [
445
+ "Crossref Funder ID",
446
+ "ROR",
447
+ "GRID",
448
+ "ISNI",
449
+ "Ringgold",
450
+ "Other"
451
+ ]
452
+ },
453
+ "funderName": { "type": "string" },
454
+ "awardNumber": { "type": "string" },
455
+ "award_uri": { "type": "string", "format": "uri" }
456
+ },
457
+ "required": ["funderName"]
458
+ }
459
+ },
460
+ "descriptions": {
461
+ "description": "The descriptions of the resource.",
462
+ "type": "array",
463
+ "items": {
464
+ "type": "object",
465
+ "properties": {
466
+ "description": {
467
+ "description": "The description of the resource.",
468
+ "type": "string"
469
+ },
470
+ "type": {
471
+ "description": "The type of the description.",
472
+ "type": "string",
473
+ "enum": ["Abstract", "Summary", "Methods", "TechnicalInfo", "Other"]
474
+ },
475
+ "language": {
476
+ "description": "The language of the title. Use one of the language codes from the IETF BCP 47 standard.",
477
+ "type": "string"
478
+ }
479
+ },
480
+ "required": ["description"]
481
+ }
482
+ },
483
+ "geo_locations": {
484
+ "type": "array",
485
+ "items": {
486
+ "type": "object",
487
+ "properties": {
488
+ "geoLocationPlace": { "type": "string" },
489
+ "geoLocationPoint": { "$ref": "#/definitions/geoLocationPoint" },
490
+ "geoLocationBox": {
491
+ "type": "object",
492
+ "properties": {
493
+ "westBoundLongitude": { "$ref": "#/definitions/longitude" },
494
+ "eastBoundLongitude": { "$ref": "#/definitions/longitude" },
495
+ "southBoundLatitude": { "$ref": "#/definitions/latitude" },
496
+ "northBoundLatitude": { "$ref": "#/definitions/latitude" }
497
+ },
498
+ "required": [
499
+ "westBoundLongitude",
500
+ "eastBoundLongitude",
501
+ "southBoundLatitude",
502
+ "northBoundLatitude"
503
+ ]
504
+ },
505
+ "geoLocationPolygons": {
506
+ "type": "array",
507
+ "items": {
508
+ "type": "object",
509
+ "properties": {
510
+ "polygonPoints": {
511
+ "type": "array",
512
+ "items": { "$ref": "#/definitions/geoLocationPoint" },
513
+ "minItems": 4
514
+ },
515
+ "inPolygonPoint": { "$ref": "#/definitions/geoLocationPoint" }
516
+ },
517
+ "required": ["polygonPoints"]
518
+ },
519
+ "uniqueItems": true
520
+ }
521
+ }
522
+ },
523
+ "uniqueItems": true
524
+ },
525
+ "provider": {
526
+ "description": "The provider of the resource. This can be a DOI registration agency or a repository.",
527
+ "type": "string",
528
+ "enum": [
529
+ "Crossref",
530
+ "DataCite",
531
+ "GitHub",
532
+ "JaLC",
533
+ "KISTI",
534
+ "mEDRA",
535
+ "OP",
536
+ "InvenioRDM"
537
+ ]
538
+ },
539
+ "alternate_identifiers": {
540
+ "description": "Alternate identifiers for the resource.",
541
+ "type": "array",
542
+ "items": {
543
+ "type": "object",
544
+ "properties": {
545
+ "alternateIdentifier": { "type": "string" },
546
+ "alternateIdentifierType": { "type": "string" }
547
+ },
548
+ "required": ["alternateIdentifier", "alternateIdentifierType"]
549
+ }
550
+ },
551
+ "files": {
552
+ "description": "The downloadable files for the resource.",
553
+ "type": "array",
554
+ "items": {
555
+ "type": "object",
556
+ "properties": {
557
+ "bucket": { "type": "string" },
558
+ "key": { "type": "string" },
559
+ "checksum": { "type": "string" },
560
+ "url": { "type": "string", "format": "uri" },
561
+ "size": { "type": "integer" },
562
+ "mimeType": { "type": "string" }
563
+ },
564
+ "required": ["url"]
565
+ }
566
+ },
567
+ "schema_version": {
568
+ "description": "The schema version of the resource.",
569
+ "type": "string",
570
+ "enum": [
571
+ "https://commonmeta.org/commonmeta_v0.10",
572
+ "https://commonmeta.org/commonmeta_v0.11",
573
+ "https://commonmeta.org/commonmeta_v0.12",
574
+ "http://datacite.org/schema/kernel-3",
575
+ "http://datacite.org/schema/kernel-4"
576
+ ]
577
+ },
578
+ "state": {
579
+ "description": "The state of the resource.",
580
+ "type": "string",
581
+ "enum": ["findable", "not_found", "forbidden", "bad_request"]
582
+ },
583
+ "archive_locations": {
584
+ "description": "The location where content is archived.",
585
+ "type": "array",
586
+ "items": {
587
+ "type": "string",
588
+ "enum": [
589
+ "CLOCKSS",
590
+ "LOCKSS",
591
+ "Portico",
592
+ "KB",
593
+ "Internet Archive",
594
+ "DWT"
595
+ ]
596
+ },
597
+ "uniqueItems": true
598
+ }
599
+ },
600
+ "required": ["id", "type"]
601
+ }