Skip to main content

CCMM-Invenio: CCMM runtime library for NRP Invenio

This library provides:

  • Fixtures for vocabularies to support the CCMM model in NRP Invenio
  • Schema serializers for the CCMM model
  • Import and export modules for the CCMM model
  • UI components for working with the CCMM model in NRP Invenio

Installation

pip install ccmm-invenio

Usage

To use CCMM in production repository, add the following model:

# models/datasets.py
production_dataset = model(
    "production_dataset",
    version="1.1.0",
    presets=[
        ccmm_production_preset,
    ],
    configuration={
        # "ui_blueprint": "myui
    },
    types=[
        {
            "Metadata": {
                "properties": {
                    # your extensions come here, ccmm_production_preset will add
                    # all ccmm fields automatically
                },
            },
        }
    ],
    metadata_type="Metadata",
    customizations=[],
)

# invenio.cfg
production_dataset.register()

How to generate new NMA and Production CCMM model mappings

Download and pre-process CCMM XML

Follow the instructions in ccmm_versions/README.md to download and pre-process the CCMM XML schemas for the desired version. This will create:

  • Cleaned XSD files in ccmm_versions/src/ccmm_versions/ccmm-<version>-<date>/out
  • A diff file in ccmm_versions/diffs/ comparing the new version to the previous one
  • A schema overview in ccmm_versions/summaries/ccmm-<version>-<date>.summary.md

Adapt CCMM model yaml files

Copy/paste the model in src/ccmm_invenio/models/<previous-version>-<date>/ to src/ccmm_invenio/models/<new-version>-<date>/.

Look at the diff file generated in the previous step and adapt the ccmm.yaml, ccmm-invenio.yaml, ccmm-vocabularies.yaml, and gml-1.1.0.yaml files in src/ccmm_invenio/models/<version>-<date>/ accordingly.

Then look at the src/ccmm_invenio/models/__init__.py file and add the new version there.

Generate NMA Parser

CCMM_VERSION_DIR=1.1.0a1-2025-10-25
CCMM_VERSION=1.1.0

python ./src/ccmm_invenio/parsers/generate_parser.py  \
       ./src/ccmm_invenio/models/$CCMM_VERSION_DIR/ccmm.yaml \
       ./src/ccmm_invenio/models/$CCMM_VERSION_DIR/ccmm-vocabularies.yaml \
       ./src/ccmm_invenio/models/$CCMM_VERSION_DIR/gml-1.1.0.yaml \
       ./src/ccmm_invenio/parsers/nma_$(echo "$CCMM_VERSION" | tr "." "_")$.py

Update production parser manually based on NMA parser

# file production_<version>.py
from .nma_<version> import CCMMXMLNMAParser

class CCMMXMLProductionParser(CCMMXMLProductionParserBase, CCMMXMLNMAParser):
    """Parser for CCMM XML version 1.1.0 for production repository."""
    # tweaks here

TODO: imports, exports

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccmm_invenio-1.1.22.tar.gz (501.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccmm_invenio-1.1.22-py3-none-any.whl (557.3 kB view details)

Uploaded Python 3

File details

Details for the file ccmm_invenio-1.1.22.tar.gz.

File metadata

  • Download URL: ccmm_invenio-1.1.22.tar.gz
  • Upload date:
  • Size: 501.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ccmm_invenio-1.1.22.tar.gz
Algorithm Hash digest
SHA256 fa582ec76d4c5d28f97cc805865d74af087d8f9500c59e2b1c8e57706496d182
MD5 b16d2ab6f2ee2989b0cb37cf1fa61459
BLAKE2b-256 0af5e02ee5413c195832161719d396045227bac2c271b015d50020f0bef823f6

See more details on using hashes here.

File details

Details for the file ccmm_invenio-1.1.22-py3-none-any.whl.

File metadata

  • Download URL: ccmm_invenio-1.1.22-py3-none-any.whl
  • Upload date:
  • Size: 557.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ccmm_invenio-1.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 54f240a5f2e19c2a7f4096f68d41af73b00ddc0dc52c3a280ec07c3cabb84e90
MD5 f2bac451c5ff12229b616ffeb92601b3
BLAKE2b-256 1e3486351e5f8afb3f1c68093a92ae0587b0d00d14b8079ef4fa5c9ebff312b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page