oarepo_config.datastreams
oarepo_config.datastreams
Configuration for datastreams.
configure_datastreams(readers: dict[str, Any] | None = None, writers: dict[str, Any] | None = None, transformers: dict[str, Any] | None = None) -> None
Register custom sources for importing vocabularies (fixtures) into the repository.
Vocabularies (controlled lists such as languages, resource types or licenses) can be loaded from files or external services using "datastreams" - a reader that fetches/reads the raw data, an optional transformer that converts it, and a writer that stores it. Invenio already ships with a set of built-in readers/writers/ transformers; use this function only if you need to add your own (for example, a reader that pulls a vocabulary from a custom REST API).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
readers
|
dict[str, Any] | None
|
Extra readers to make available, as a mapping of a
short name to either an import path string
( |
None
|
writers
|
dict[str, Any] | None
|
Extra writers to make available, in the same format as
|
None
|
transformers
|
dict[str, Any] | None
|
Extra transformers to make available, in the same
format as |
None
|
Any readers/writers/transformers already registered (for example by
configure_generic_parameters) are kept; the ones passed here
are added on top.
Invenio configuration variables set:
VOCABULARIES_DATASTREAM_READERS- only ifreadersis given; merged with any existing value.VOCABULARIES_DATASTREAM_WRITERS- only ifwritersis given; merged with any existing value.VOCABULARIES_DATASTREAM_TRANSFORMERS- only iftransformersis given; merged with any existing value.