commonmeta-py 0.143__tar.gz → 0.145__tar.gz
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_py-0.143 → commonmeta_py-0.145}/.gitignore +0 -1
- {commonmeta_py-0.143 → commonmeta_py-0.145}/PKG-INFO +1 -1
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/__init__.py +1 -1
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/doi_utils.py +7 -9
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/inveniordm_writer.py +0 -5
- {commonmeta_py-0.143 → commonmeta_py-0.145}/pyproject.toml +1 -1
- {commonmeta_py-0.143 → commonmeta_py-0.145}/LICENSE +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/README.md +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/api_utils.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/author_utils.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/base_utils.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/cli.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/constants.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/date_utils.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/file_utils.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/metadata.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/__init__.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/bibtex_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/cff_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/codemeta_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/commonmeta_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/crossref_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/crossref_xml_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/csl_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/datacite_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/datacite_xml_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/inveniordm_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/jsonfeed_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/kbase_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/openalex_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/ris_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/readers/schema_org_reader.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/cff_v1.2.0.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/commonmeta_v0.12.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/commonmeta_v0.13.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/commonmeta_v0.14.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/commonmeta_v0.15.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/commonmeta_v0.16.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/AccessIndicators.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3-elements.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/JATS-journalpublishing1-elements.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/JATS-journalpublishing1-mathml3-elements.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/JATS-journalpublishing1-mathml3.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/JATS-journalpublishing1.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/clinicaltrials.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/common5.4.0.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/crossref5.4.0.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/crossref_query_output3.0.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/doi_resources5.4.0.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/fundingdata5.4.0.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/fundref.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/languages5.4.0.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/mediatypes5.4.0.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/module-ali.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/relations.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/mathml3/mathml3-common.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/mathml3/mathml3-content.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/mathml3/mathml3-presentation.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/mathml3/mathml3-strict-content.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/mathml3/mathml3.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/mathml3/module-ali.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/module-ali.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/xlink.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/xml.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/xml.xsd +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref-v0.2.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/csl-data.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/datacite-v4.5.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/datacite-v4.5pr.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/spdx/licenses.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/spdx-schema.json +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/apa.csl +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/chicago-author-date.csl +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/harvard-cite-them-right.csl +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/ieee.csl +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/modern-language-association.csl +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/vancouver.csl +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/schema_utils.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/translators.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/utils.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/__init__.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/bibtex_writer.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/citation_writer.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/commonmeta_writer.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/crossref_xml_writer.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/csl_writer.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/datacite_writer.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/ris_writer.py +0 -0
- {commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/writers/schema_org_writer.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: commonmeta-py
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.145
|
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
|
@@ -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
|
@@ -438,19 +438,15 @@ def push_inveniordm(metadata: Commonmeta, host: str, token: str, **kwargs) -> Di
|
|
438
438
|
|
439
439
|
# upsert record via the InvenioRDM API
|
440
440
|
record = upsert_record(metadata, host, token, record)
|
441
|
-
print("Record after upsert:", record)
|
442
441
|
|
443
442
|
# optionally add record to InvenioRDM communities
|
444
443
|
record = add_record_to_communities(metadata, host, token, record)
|
445
|
-
print("Record after adding to communities:", record)
|
446
444
|
|
447
445
|
# optionally update external services
|
448
446
|
record = update_external_services(metadata, host, token, record, **kwargs)
|
449
|
-
print("Record after updating external services:", record)
|
450
447
|
|
451
448
|
except Exception as e:
|
452
449
|
print(f"Error in push_inveniordm: {str(e)}")
|
453
|
-
print("Record before error:", record)
|
454
450
|
logger.error(
|
455
451
|
f"Unexpected error in push_inveniordm: {str(e)}",
|
456
452
|
exc_info=True,
|
@@ -744,7 +740,6 @@ def update_legacy_record(record, legacy_key: str, field: str = None) -> dict:
|
|
744
740
|
"registered": "false",
|
745
741
|
}
|
746
742
|
elif record.get("doi", None) is not None:
|
747
|
-
print(f"Updating legacy record for {record['uuid']} with field {field}")
|
748
743
|
output = {
|
749
744
|
"registered": "true",
|
750
745
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "commonmeta-py"
|
3
|
-
version = "0.
|
3
|
+
version = "0.145"
|
4
4
|
description = "Library for conversions to/from the Commonmeta scholarly metadata format"
|
5
5
|
authors = [{ name = "Martin Fenner", email = "martin@front-matter.io" }]
|
6
6
|
requires-python = ">=3.9,<4.0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/AccessIndicators.xsd
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/clinicaltrials.xsd
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/doi_resources5.4.0.xsd
RENAMED
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/fundingdata5.4.0.xsd
RENAMED
File without changes
|
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/languages5.4.0.xsd
RENAMED
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/mediatypes5.4.0.xsd
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/xlink.xsd
RENAMED
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/crossref/standard-modules/xml.xsd
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/chicago-author-date.csl
RENAMED
File without changes
|
{commonmeta_py-0.143 → commonmeta_py-0.145}/commonmeta/resources/styles/harvard-cite-them-right.csl
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|