Skip to main content

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
initialize_i18n() Enable translated validation error messages.
initialize_glitchtip(dsn=None, deployment_version=None) Set up error reporting to Glitchtip/Sentry (optional dependency).
configure_generic_parameters(languages=..., use_path_pid_ids=False) Core infrastructure: URLs, security headers, login, database, S3, OpenSearch, Redis, Celery, secret key, default identifier/vocabulary schemes. Call this first.
configure_ui(code=..., name=..., ...) Branding, theme, page templates, front page and analytics.
configure_communities(communities_roles=None) Community roles and who can do what inside a community.
configure_workflows(*workflow_definitions, ...) Set up submission/review workflows from IndividualWorkflow/CommunityWorkflow definitions. Preferred over register_workflow() for most repositories.
register_workflow(workflow_code, workflow_name, permissions_policy, requests_policy) Low-level, single-workflow building block; registers one workflow directly instead of going through configure_workflows(). Warns by default recommending configure_workflows() instead - pass use_low_level_workflows=True to silence it.
configure_cron(**extra_cron_items) Scheduled background jobs (CELERY_BEAT_SCHEDULE).
configure_stats(enable=True) Usage statistics (record views, downloads, ...).
configure_vocabulary(code, **kwargs) Declare a custom controlled vocabulary.
configure_datastreams(readers=None, writers=None, transformers=None) Register custom vocabulary-import sources.
configure_jobs(permission_policy=None, logging_level=None) Who can view "Jobs" admin logs, and how verbose they are.
configure_oai() OAI-PMH repository name. Call after configure_ui().
configure_einfra_oidc() "Log in with e-INFRA" (CESNET/Perun) single sign-on.
configure_llm(api_token=None, ...) LLM client(s) for oarepo-checks' AI-assisted record validation (optional dependency).
add_model(model_package_name) Register a data model for global/cross-model search.
load_configuration_variables() Read the deployment's INVENIO_... configuration values.
override_configuration(env=None) Set arbitrary config constants straight from INVENIO_<X> env vars.

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oarepo_config-2.0.1.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oarepo_config-2.0.1-py3-none-any.whl (58.3 kB view details)

Uploaded Python 3

File details

Details for the file oarepo_config-2.0.1.tar.gz.

File metadata

  • Download URL: oarepo_config-2.0.1.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for oarepo_config-2.0.1.tar.gz
Algorithm Hash digest
SHA256 b664f7ade835eefab36fe388aaf8c8d8aab39501be4ac3ba3537b3f2d41c7791
MD5 91091dca57a73a8edbb39a7bb23961e7
BLAKE2b-256 8a8ba628ac9b14b2080805f59f8b52b73cbc0fe2d68896ff54803b9b7a560017

See more details on using hashes here.

File details

Details for the file oarepo_config-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: oarepo_config-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 58.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for oarepo_config-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cbce78dcd64e1c4aa3948b997a8105a730c1a79b4e0c891c6eb8f5059e5ab20
MD5 04ba5d9238d19143105e5f94f6e30e2c
BLAKE2b-256 7bee5350320226384628b6034be26df05ddfc49f9e8d5357f9b45cb803fc7ebe

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

This release

2.0.1 This release

2 files

2.0.0

2 files

1.2.0

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

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