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.1.0

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.1.0
File Size Uploaded Provenance Actions
oarepo_formats-1.1.0.tar.gz 117.5 kB Without provenance Details for oarepo_formats-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 265.7 kB

Release files / oarepo_formats-1.1.0.tar.gz

Download URL oarepo_formats-1.1.0.tar.gz
Size 117.5 kB
Tags Source
SHA-256 checksum
How to use checksums
79c95ad267c4f1cb4eecc1e07f9968ede545b784530b04780c585602d5105d89
BLAKE2b-256 checksum
How to use checksums
a1b4e46cd32d6697ec5d0a3d1a8646ea9c5d2a51eee3db7ce31991d6841c1c14
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.1.0-py3-none-any.whl

Download URL oarepo_formats-1.1.0-py3-none-any.whl
Size 148.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
703a4527b61d638e5bc5bf2c199fb1ee12b652c6e723e8a3ca65abfd08601527
BLAKE2b-256 checksum
How to use checksums
646f77f745ca6f4c905ab0cf2abb3f1dd32f8c9db7accc47eaa5c84f4e620bdb
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.1.0

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.

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