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.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.0.0
File Size Uploaded Provenance Actions
oarepo_formats-1.0.0.tar.gz 116.5 kB Without provenance Details for oarepo_formats-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 263.5 kB

Release files / oarepo_formats-1.0.0.tar.gz

Download URL oarepo_formats-1.0.0.tar.gz
Size 116.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a5f91ce377aaffdbf4c6870f61eaed4e1f93fa75cec759b7bdf1ffeeef351414
BLAKE2b-256 checksum
How to use checksums
834b016a53327f04ff112d8453c3d1361d90ce18dcf729d917657ee35f785b1e
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.0-py3-none-any.whl

Download URL oarepo_formats-1.0.0-py3-none-any.whl
Size 147.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b760bfdfe7bf35a76b9940784215829cce39c5e751bcbd83c8506161ab1984e9
BLAKE2b-256 checksum
How to use checksums
4f50186bc3b16540f992ad79df3187eeef43166dc5e619dca450fd9a8df70379
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.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.

Release history Release notifications | RSS feed

This release

1.0.0 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