Metadata-Version: 2.5
Name: invenio-records-marc21
Version: 0.36.0
Summary: Invenio Marc21 datamodel.
Project-URL: Repository, https://github.com/tu-graz-library/invenio-records-marc21
Author: Graz University of Technology.
License-Expression: MIT
License-File: LICENSE
Keywords: Marc21,invenio,record
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: arrow>=1.0.0
Requires-Dist: fastjsonschema>=2.16.0
Requires-Dist: invenio-rdm-records>=24.0.0
Requires-Dist: invenio-stats>=6.0.0
Requires-Dist: lxml>=4.6.2
Provides-Extra: tests
Requires-Dist: decorator>=5.0.0; extra == 'tests'
Requires-Dist: djlint>=1.0.0; extra == 'tests'
Requires-Dist: invenio-app<4.0.0,>=3.0.0; extra == 'tests'
Requires-Dist: invenio-cache>=v3.0.0; extra == 'tests'
Requires-Dist: invenio-db<3.0.0,>=2.2.0; extra == 'tests'
Requires-Dist: invenio-i18n<4.0.0,>=3.0.0; extra == 'tests'
Requires-Dist: invenio-previewer<6.0.0,>=5.0.0; extra == 'tests'
Requires-Dist: invenio-search[opensearch2]<4.0.0,>=3.0.0; extra == 'tests'
Requires-Dist: pytest-black>=0.6.0; extra == 'tests'
Requires-Dist: pytest-invenio<5.0.0,>=4.0.0; extra == 'tests'
Requires-Dist: pytest-mock>=1.6.0; extra == 'tests'
Description-Content-Type: text/markdown

<!--
SPDX-FileCopyrightText: 2021-2026 Graz University of Technology.
SPDX-License-Identifier: MIT
-->

# Invenio-Records-Marc21

Marc21 datamodel

Further documentation is available on
https://invenio-records-marc21.readthedocs.io/



## Install


Choose a version of elasticsearch and a DB, then run:

```console

uv run pip install -e .[all]
```

## Setting Up Statistics


To enable and configure the statistics feature using MARC21 records in Invenio, you need to update your `invenio.cfg` file with specific configurations that integrate MARC21 statistics with Invenio's standard statistics modules.

### Configuration Steps

1. **Import Required Configurations:**

   Before updating the configuration values, ensure that you import the necessary settings from both the `invenio_records_marc21` module and the `invenio_app_rdm` module. Add the following lines to your `invenio.cfg`:

```console

from invenio_records_marc21.config import MARC21_STATS_CELERY_TASKS, MARC21_STATS_EVENTS, MARC21_STATS_AGGREGATIONS, MARC21_STATS_QUERIES
from invenio_app_rdm.config import CELERY_BEAT_SCHEDULE, STATS_EVENTS, STATS_AGGREGATIONS, STATS_QUERIES
```

Update Celery Beat Schedule:

Integrate MARC21-specific scheduled tasks with Invenio's scheduler:


```console
CELERY_BEAT_SCHEDULE.update(MARC21_STATS_CELERY_TASKS)
```

Update Events, Aggregations, and Queries:

Merge MARC21 statistics configurations with the global statistics settings:


```console
STATS_EVENTS.update(MARC21_STATS_EVENTS)
STATS_AGGREGATIONS.update(MARC21_STATS_AGGREGATIONS)
STATS_QUERIES.update(MARC21_STATS_QUERIES)
```

## Features

### custom doi over 024 field in metadata

add the field 024 like `024.7.. $$2 doi $$a 10.0356/894-849-056 $$q tugraz-publisher`. the important part is the `$$q tugraz-publisher` which indicates that there is a special doi which overrides the normal DOI.

the doi will be created on the publish, so the 856 field will show up after publishing the record.


## Tests


```console
uv run ./run-tests.sh
```
