oarepo-config¶
Helper library for writing a clean, high-level invenio.cfg for
OARepo/Invenio-RDM based repositories.
Instead of hand-assembling dozens of Flask/Invenio config constants,
invenio.cfg calls a small number of configure_*() functions; each one
computes a group of related settings and writes them directly into
invenio.cfg’s own configuration, as if you had set them by hand.
📖 Full documentation — API reference (every parameter and every Invenio variable each function sets), environment variables, call ordering, a full example, and how the package works internally.
Installation¶
pip install oarepo-config
It is normally pulled in transitively as part of an oarepo-app
installation, but can also be used standalone. Requires Python 3.14 and
oarepo[rdm,tests] 14.x (see pyproject.toml).
Quick start¶
# invenio.cfg
import oarepo_config as config
from invenio_i18n import lazy_gettext as _
config.initialize_i18n()
config.configure_generic_parameters(
languages=(("cs", _("Czech")),),
)
config.configure_ui(
code="myrepo",
name=_("My Repository"),
description=_("Description of my repository"),
)
config.configure_communities()
config.configure_cron()
config.configure_stats()
# Feel free to add/override plain CONFIG_VARIABLE = value assignments
# below, or wrap them with config.override_configuration() to source them
# from the environment.
Values are read from a variables/.env file or the process environment
(INVENIO_*) — see
Configuration sources and precedence
for the loading rules, and
Ordering for
why the calls above are in this order.
Functions¶
Call these directly at module level in invenio.cfg (see
how it works internally
for why). Click a function for its full parameter docs and the exact list
of Invenio config variables it sets.
Function |
What it does |
|---|---|
Enable translated validation error messages. |
|
Set up error reporting to Glitchtip/Sentry (optional dependency). |
|
|
Core infrastructure: URLs, security headers, login, database, S3, OpenSearch, Redis, Celery, secret key, default identifier/vocabulary schemes. Call this first. |
Branding, theme, page templates, front page and analytics. |
|
Community roles and who can do what inside a community. |
|
Set up submission/review workflows from |
|
|
Low-level, single-workflow building block; registers one workflow directly instead of going through |
Scheduled background jobs ( |
|
Usage statistics (record views, downloads, …). |
|
Declare a custom controlled vocabulary. |
|
|
Register custom vocabulary-import sources. |
Who can view “Jobs” admin logs, and how verbose they are. |
|
OAI-PMH repository name. Call after |
|
“Log in with e-INFRA” (CESNET/Perun) single sign-on. |
|
LLM client(s) for oarepo-checks’ AI-assisted record validation (optional dependency). |
|
Register a data model for global/cross-model search. |
|
Read the deployment’s |
|
Set arbitrary config constants straight from |
Documentation¶
The full documentation site
covers everything that doesn’t fit here: the complete environment
variable reference, call-ordering rules, a full production invenio.cfg
example, and how the “write into invenio.cfg’s globals” mechanism
works internally. Build it locally with ./docs/build.sh (add --open
or --serve).