commonmeta-py 0.142__py3-none-any.whl → 0.144__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 +1 -1
- commonmeta/doi_utils.py +7 -9
- commonmeta/writers/inveniordm_writer.py +3 -1
- {commonmeta_py-0.142.dist-info → commonmeta_py-0.144.dist-info}/METADATA +1 -1
- {commonmeta_py-0.142.dist-info → commonmeta_py-0.144.dist-info}/RECORD +8 -8
- {commonmeta_py-0.142.dist-info → commonmeta_py-0.144.dist-info}/WHEEL +0 -0
- {commonmeta_py-0.142.dist-info → commonmeta_py-0.144.dist-info}/entry_points.txt +0 -0
- {commonmeta_py-0.142.dist-info → commonmeta_py-0.144.dist-info}/licenses/LICENSE +0 -0
commonmeta/__init__.py
CHANGED
commonmeta/doi_utils.py
CHANGED
@@ -350,17 +350,18 @@ def generate_wordpress_doi(prefix: str, slug: str, guid: str) -> str:
|
|
350
350
|
pattern = re.compile(r"p=(\d+)$")
|
351
351
|
matched = pattern.search(guid)
|
352
352
|
|
353
|
-
if
|
354
|
-
|
353
|
+
if matched:
|
354
|
+
suffix = f"{slug}.{matched.group(1)}"
|
355
|
+
else:
|
356
|
+
# post_id not found, use random base32 encoding
|
357
|
+
suffix = base32.generate(length=10, split_every=5, checksum=True)
|
355
358
|
|
356
|
-
doi = f"https://doi.org/{prefix}/{
|
359
|
+
doi = f"https://doi.org/{prefix}/{suffix}"
|
357
360
|
return doi
|
358
361
|
|
359
362
|
|
360
363
|
def validate_doi_from_guid(prefix: str, guid: str, checksum=True) -> bool:
|
361
364
|
"""Validates a GUID that is a DOI"""
|
362
|
-
import base32_lib as base32
|
363
|
-
|
364
365
|
if not prefix:
|
365
366
|
return False
|
366
367
|
|
@@ -383,8 +384,6 @@ def validate_doi_from_guid(prefix: str, guid: str, checksum=True) -> bool:
|
|
383
384
|
|
384
385
|
def generate_substack_doi(prefix: str, guid: str) -> str:
|
385
386
|
"""Generate a DOI from a Substack GUID"""
|
386
|
-
import base32_lib as base32
|
387
|
-
|
388
387
|
if not prefix or not guid:
|
389
388
|
return ""
|
390
389
|
|
@@ -393,7 +392,6 @@ def generate_substack_doi(prefix: str, guid: str) -> str:
|
|
393
392
|
except ValueError:
|
394
393
|
return ""
|
395
394
|
|
396
|
-
|
397
|
-
suffix = base32.encode(i, length=4, split_every=8, checksum=True)
|
395
|
+
suffix = base32.encode(i, split_every=5, min_length=10, checksum=True)
|
398
396
|
doi = f"https://doi.org/{prefix}/{suffix}"
|
399
397
|
return doi
|
@@ -417,6 +417,7 @@ def push_inveniordm(metadata: Commonmeta, host: str, token: str, **kwargs) -> Di
|
|
417
417
|
"identifier"
|
418
418
|
):
|
419
419
|
record["uuid"] = identifier.get("identifier")
|
420
|
+
continue
|
420
421
|
|
421
422
|
if hasattr(metadata, "relations") and metadata.relations:
|
422
423
|
community_index = None
|
@@ -430,7 +431,7 @@ def push_inveniordm(metadata: Commonmeta, host: str, token: str, **kwargs) -> Di
|
|
430
431
|
record["community"] = slug
|
431
432
|
record["community_id"] = community_id
|
432
433
|
community_index = i
|
433
|
-
|
434
|
+
continue
|
434
435
|
|
435
436
|
if community_index is not None:
|
436
437
|
metadata.relations.pop(community_index)
|
@@ -445,6 +446,7 @@ def push_inveniordm(metadata: Commonmeta, host: str, token: str, **kwargs) -> Di
|
|
445
446
|
record = update_external_services(metadata, host, token, record, **kwargs)
|
446
447
|
|
447
448
|
except Exception as e:
|
449
|
+
print(f"Error in push_inveniordm: {str(e)}")
|
448
450
|
logger.error(
|
449
451
|
f"Unexpected error in push_inveniordm: {str(e)}",
|
450
452
|
exc_info=True,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: commonmeta-py
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.144
|
4
4
|
Summary: Library for conversions to/from the Commonmeta scholarly metadata format
|
5
5
|
Project-URL: Homepage, https://python.commonmeta.org
|
6
6
|
Project-URL: Repository, https://github.com/front-matter/commonmeta-py
|
@@ -1,11 +1,11 @@
|
|
1
|
-
commonmeta/__init__.py,sha256=
|
1
|
+
commonmeta/__init__.py,sha256=VPRya2OKHRRVIAhd10O8afGbXOJrRZykMj6G2f501VA,2118
|
2
2
|
commonmeta/api_utils.py,sha256=P8LMHHYiF4OTi97_5k4KstcBreooMkOAKZ4ebxsAv4o,2691
|
3
3
|
commonmeta/author_utils.py,sha256=3lYW5s1rOUWNTKs1FP6XLfEUY3yCLOe_3L_VdJTDMp0,8585
|
4
4
|
commonmeta/base_utils.py,sha256=-MGy9q2uTiJEkPWQUYOJMdq-3tRpNnvBwlLjvllQ5g8,11164
|
5
5
|
commonmeta/cli.py,sha256=kBDSn7hL29I_ICn8XKFFEaIWl_ZVE_KrNWpzfar9v3g,8639
|
6
6
|
commonmeta/constants.py,sha256=wSTEUiHeRdXLwjXEQD9AU2hxFyEKi5OTX2iHOKO6nF0,19844
|
7
7
|
commonmeta/date_utils.py,sha256=H2cCobX0JREIUOT_cCigGd3MG7prGiQpXk1m4ZNrFwU,6318
|
8
|
-
commonmeta/doi_utils.py,sha256=
|
8
|
+
commonmeta/doi_utils.py,sha256=dmHy6QsF3v69cDwvw-v9RX2uys72w6UPsqzAnNePO2w,11512
|
9
9
|
commonmeta/file_utils.py,sha256=eFYDWyR8Gr722nvFmp542hCm-TGmO_q4ciZ85IPHpjA,2893
|
10
10
|
commonmeta/metadata.py,sha256=xh5RNy9f7uKu5AjoPKyLqHGx149tGFy3IZwrf-fYHzg,18597
|
11
11
|
commonmeta/schema_utils.py,sha256=zn3gqAHciUOQmrw9okR68weFs-yqPPyORFt-Zl1D3Lw,1924
|
@@ -80,11 +80,11 @@ commonmeta/writers/commonmeta_writer.py,sha256=QpfyhG__7o_XpsOTCPWxGymO7YKwZi2LQ
|
|
80
80
|
commonmeta/writers/crossref_xml_writer.py,sha256=nyNgnyluzd9jZ6jysrSg_TpMNOQuVjfMo7pN0HUb3c0,34832
|
81
81
|
commonmeta/writers/csl_writer.py,sha256=4gDYs1EzK4_L2UIRTfs25wgHmYRwdRP2zmfxF9387oU,2779
|
82
82
|
commonmeta/writers/datacite_writer.py,sha256=bcinpwhq7XnVthKHH8-sdXA34dSlvFH4ImYH768iaQU,6428
|
83
|
-
commonmeta/writers/inveniordm_writer.py,sha256=
|
83
|
+
commonmeta/writers/inveniordm_writer.py,sha256=OzFz59dc5997x6feSF7J6rorxG1HBiFN6Z2yzKSxRcw,27239
|
84
84
|
commonmeta/writers/ris_writer.py,sha256=3SdyEvMRaPRP1SV1MB-MXBlunE7x6og7RF1zuWtetPc,2094
|
85
85
|
commonmeta/writers/schema_org_writer.py,sha256=s18_x0ReXwAGBoEAwp2q-HCgFQ-h5qRg6JyAlqCoSFE,5871
|
86
|
-
commonmeta_py-0.
|
87
|
-
commonmeta_py-0.
|
88
|
-
commonmeta_py-0.
|
89
|
-
commonmeta_py-0.
|
90
|
-
commonmeta_py-0.
|
86
|
+
commonmeta_py-0.144.dist-info/METADATA,sha256=FgnMR4Dn-fYtcGP20-h1wBAfX7-3SxbKyL2dJJ-jDdE,7656
|
87
|
+
commonmeta_py-0.144.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
88
|
+
commonmeta_py-0.144.dist-info/entry_points.txt,sha256=U4w4BoRuS3rN5t5Y-uYSyOeU5Lh_VRVMS9OIDzIgw4w,50
|
89
|
+
commonmeta_py-0.144.dist-info/licenses/LICENSE,sha256=wsIvxF9Q9GC9vA_s79zTWP3BkXJdfUNRmALlU8GbW1s,1074
|
90
|
+
commonmeta_py-0.144.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|