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

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.2
File Size Uploaded Provenance Actions
oarepo_formats-1.0.2.tar.gz 116.9 kB Without provenance Details for oarepo_formats-1.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 264.2 kB

Release files / oarepo_formats-1.0.2.tar.gz

Download URL oarepo_formats-1.0.2.tar.gz
Size 116.9 kB
Tags Source
SHA-256 checksum
How to use checksums
192f4fd73aba45a1ca5c6a0ee53ebd5bef8f588af4566c210c04526205cfd729
BLAKE2b-256 checksum
How to use checksums
36127e348a5baca73c064323083d1476face8e3869410652414fe84846840bed
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.2-py3-none-any.whl

Download URL oarepo_formats-1.0.2-py3-none-any.whl
Size 147.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06fb43520d56da98ecab010898efa2dd340487adaddad844f7f13784feb3fd11
BLAKE2b-256 checksum
How to use checksums
64e45f3a8d13f92b13bee1582781ed5cb83fdcf2186130f985ee0f4c47f6623b
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.2

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