Skip to main content

OARepo Formats

Format conversions for imports and exports of OARepo / Invenio repositories.

The package collects support for several formats. Each lives in its own subpackage and has its own page in the documentation:

Format Package Documentation
XSLT 3.0 oarepo_formats.xslt sandboxed XSLT transformations of imported and exported XML (REST API, OAI-PMH harvester and server) docs/xslt.md ("XSLT" page)
RO-Crate oarepo_formats.rocrate export of a record as a JSON-LD RO-Crate, as a streamed ZIP with all its files, or as a streamed zipped BagIt bag (AIP-compatible) docs/rocrate.md ("RO-Crate" page)
README oarepo_formats.readme export of a record as a generated README (<id>.generated.md) following the Czech Data Steward Community template; the Jinja template can be overridden docs/readme.md ("README" page)

Installation

pip install oarepo-formats

Requires Python 3.14 and Invenio 14.

Usage

The formats are plugged into a model with oarepo-model customizations, for example:

from oarepo_formats.readme import AddReadmeExport
from oarepo_formats.rocrate import AddROCrateBagItExport, AddROCrateExport, AddROCrateZipExport
from oarepo_formats.xslt import AddXSLTExport

customizations = [
    AddXSLTExport(
        code="ccmm-xml-2",
        name=_("CCMM 2.0 XML"),
        mimetype="application/x-ccmm-2+xml",
        stylesheet="ccmm_invenio.xslt:ccmm-1.1.0-to-2.0.0.xslt",
        base_export="ccmm-xml",  # an export the model already has
    ),
    AddROCrateExport(),
    AddROCrateZipExport(),
    AddROCrateBagItExport(),
    AddReadmeExport(),
]

See the format pages for requirements, configuration and customization.

The record's PID

The README and RO-Crate exports identify the record by its PID - its DOI by default. A repository minting other PIDs (ePIC handles, ARKs, ...) lists the DataCite identifierTypes in priority order in invenio.cfg; the first one the record has in its DataCite identifiers is used:

OAREPO_FORMATS_PID_SCHEMES = ["DOI", "Handle", "ARK"]

The value may also be a callable (record, datacite) -> list, choosing the list per record (e.g. per model).

Development

./run.sh venv
./run.sh test                              # everything; the integration tests (tests/api_tests) need the docker services
./run.sh test --skip-services tests/xslt   # the XSLT sandbox tests need none
./run.sh lint
./run.sh docs                              # build the documentation

License

MIT, see LICENSE.

Metadata

Release files for oarepo-formats 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oarepo-formats 1.0.1
File Size Uploaded Provenance Actions
oarepo_formats-1.0.1.tar.gz 116.8 kB Without provenance Details for oarepo_formats-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oarepo-formats 1.0.1
File Interpreter ABI Platform Actions
oarepo_formats-1.0.1-py3-none-any.whl Python 3 none any Details for oarepo_formats-1.0.1-py3-none-any.whl

Total release size: 264.0 kB

Release files / oarepo_formats-1.0.1.tar.gz

Download URL oarepo_formats-1.0.1.tar.gz
Size 116.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bf33e8444e04aae5bddb65784db6639b4b50ed4369ef94f4c5d95ad558d917f8
BLAKE2b-256 checksum
How to use checksums
7cb9b2edc9644ed652f30fd6b0f8da96a0c065087058f108eca263ab9d5e7f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oarepo_formats-1.0.1-py3-none-any.whl

Download URL oarepo_formats-1.0.1-py3-none-any.whl
Size 147.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
938b779c436bd2e925492d7be13aa417b2c615a029e93e87cc128cced26afffe
BLAKE2b-256 checksum
How to use checksums
436f16fb72168efea24cbbbabfab0da407a7f5e6bd3e316ec6d118f627eb2934
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for oarepo-formats 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page