commonmeta-py 0.28__py3-none-any.whl → 0.29__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.
commonmeta/__init__.py CHANGED
@@ -10,7 +10,7 @@ commonmeta-py is a Python library to convert scholarly metadata
10
10
  """
11
11
 
12
12
  __title__ = "commonmeta-py"
13
- __version__ = "0.28"
13
+ __version__ = "0.29"
14
14
  __author__ = "Martin Fenner"
15
15
  __license__ = "MIT"
16
16
 
@@ -50,32 +50,40 @@ def write_inveniordm(metadata):
50
50
  },
51
51
  "access": {"record": "public", "files": "public"},
52
52
  "files": {"enabled": True},
53
- "metadata": {
54
- "resource_type": {"id": _type},
55
- "creators": creators,
56
- "title": parse_attributes(metadata.titles, content="title", first=True),
57
- "publisher": metadata.publisher.get("name", None)
58
- if metadata.publisher
59
- else None,
60
- "publication_date": metadata.date.get("published")
61
- if metadata.date.get("published", None)
62
- else None,
63
- "dates": [{"date": metadata.date.get("updated"), "type": "updated"}],
64
- "subjects": parse_attributes(
65
- wrap(metadata.subjects), content="subject", first=False
66
- ),
67
- "description": parse_attributes(
68
- metadata.descriptions, content="description", first=True
69
- ),
70
- "rights": [{"id": metadata.license.get("id").lower()}]
71
- if metadata.license.get("id", None)
72
- else None,
73
- "languages": [{"id": get_language(metadata.language, format="alpha_3")}]
74
- if metadata.language
75
- else None,
76
- "identifiers": identifiers,
77
- "version": metadata.version,
78
- },
53
+ "metadata": compact(
54
+ {
55
+ "resource_type": {"id": _type},
56
+ "creators": creators,
57
+ "title": parse_attributes(
58
+ metadata.titles, content="title", first=True
59
+ ),
60
+ "publisher": metadata.publisher.get("name", None)
61
+ if metadata.publisher
62
+ else None,
63
+ "publication_date": metadata.date.get("published")
64
+ if metadata.date.get("published", None)
65
+ else None,
66
+ "dates": [
67
+ {"date": metadata.date.get("updated"), "type": "updated"}
68
+ ],
69
+ "subjects": parse_attributes(
70
+ wrap(metadata.subjects), content="subject", first=False
71
+ ),
72
+ "description": parse_attributes(
73
+ metadata.descriptions, content="description", first=True
74
+ ),
75
+ "rights": [{"id": metadata.license.get("id").lower()}]
76
+ if metadata.license.get("id", None)
77
+ else None,
78
+ "languages": [
79
+ {"id": get_language(metadata.language, format="alpha_3")}
80
+ ]
81
+ if metadata.language
82
+ else None,
83
+ "identifiers": identifiers,
84
+ "version": metadata.version,
85
+ }
86
+ ),
79
87
  "custom_fields": {
80
88
  "journal:journal": compact({"title": journal, "issn": issn}),
81
89
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: commonmeta-py
3
- Version: 0.28
3
+ Version: 0.29
4
4
  Summary: Library for conversions to/from the Commonmeta scholarly metadata format
5
5
  Home-page: https://python.commonmeta.org
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- commonmeta/__init__.py,sha256=l9Gei4VS6uN-Tn-TvRFHSU-LaCoIczb2ma9wIQ_Ijkc,1779
1
+ commonmeta/__init__.py,sha256=XbZIno8As7TrX6Ihdgd-pUSg8g57DDnDYMH4ypQhwUI,1779
2
2
  commonmeta/api_utils.py,sha256=-ZHGVZZhJqnjnsLtp4-PoeHYbDqL0cQme7W70BEjo4U,2677
3
3
  commonmeta/author_utils.py,sha256=zBIPTgP5n7Zx57xomJ2h7x0dvC0AV8gJ2gPoYeDy5Lo,8348
4
4
  commonmeta/base_utils.py,sha256=0t6fr9XGeeTBoMlKSAMI7p_EmKsA6wYRW0roEBXVcc8,3722
@@ -65,11 +65,11 @@ commonmeta/writers/commonmeta_writer.py,sha256=2qlttCfYpGhfVjrYkjzbIra7AywssRLT3
65
65
  commonmeta/writers/crossref_xml_writer.py,sha256=0Ds494RnXfdfjWw5CLX1kwV2zP7gqffdVqO-X74Uc6c,492
66
66
  commonmeta/writers/csl_writer.py,sha256=rlCeShkvC6ui9By0yVfNCMay_JfaZ4AooUPOPg-g-2M,2819
67
67
  commonmeta/writers/datacite_writer.py,sha256=G7Lr0aZ4sAEdbfXe3dG4Y6AyGUKA9UWr_iiaQRDnV24,6233
68
- commonmeta/writers/inveniordm_writer.py,sha256=9-ihjV1eYYMH_RdWEUcWjVOXBxQj3Cc7_jFhYmZPXBA,4187
68
+ commonmeta/writers/inveniordm_writer.py,sha256=lfuNdyHxyQa3rfioM8kGZh-p6h8Grl2B581f_feN8f8,4464
69
69
  commonmeta/writers/ris_writer.py,sha256=AcnCszS3WY9lF594NbFBtLylsA8ownnYp_XLQJ84Ios,2093
70
70
  commonmeta/writers/schema_org_writer.py,sha256=5j002uCNLdlScZMNQmPjodcVWqaBh2z38zL1H4lo2hY,5741
71
- commonmeta_py-0.28.dist-info/LICENSE,sha256=746hEF2wZCKkcckk5-_DcBLtHewfaEMS4iXTlA1PVwk,1074
72
- commonmeta_py-0.28.dist-info/METADATA,sha256=2jU1ooKe66ldNyOysJOIGhKiqDCRU8PkG4vYwhZ1i9g,8331
73
- commonmeta_py-0.28.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
74
- commonmeta_py-0.28.dist-info/entry_points.txt,sha256=vbcDw3_2lMTKdcAL2VUF4DRYRpKuzXVYLMCdgKVf88U,49
75
- commonmeta_py-0.28.dist-info/RECORD,,
71
+ commonmeta_py-0.29.dist-info/LICENSE,sha256=746hEF2wZCKkcckk5-_DcBLtHewfaEMS4iXTlA1PVwk,1074
72
+ commonmeta_py-0.29.dist-info/METADATA,sha256=IQuSLd0PAay6UcUHIxjifYg6YWZMQD5fdOgM5dODSzY,8331
73
+ commonmeta_py-0.29.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
74
+ commonmeta_py-0.29.dist-info/entry_points.txt,sha256=vbcDw3_2lMTKdcAL2VUF4DRYRpKuzXVYLMCdgKVf88U,49
75
+ commonmeta_py-0.29.dist-info/RECORD,,