Skip to main content

A set of runtime extensions of Invenio repository

Project description

OARepo runtime

The base of invenio oarepo client and a set of classes/functions that help with code-generated features:

Custom fields

Provides support for custom fields identification and iteration and invenio oarepo cf init initialization tool for customfields.

Expansions

Provides expandable field implementation and service mixin for referenced record (in case you do not want to use relations).

Facets

An implementation of nested labeled facet.

i18n

Validator for language codes.

Relations

Replacement of Invenio relations. Fixes the following issues:

  1. Invenio relations can occur only on specific paths and for each pattern, different class must be used (Relation, ListRelation, NestedListRelation)
  2. PID Cache is isolated per request, not set directly on field
  3. Allows to map keys - A key from related object can be renamed/remapped to a different key/path
  4. Provides classes to reference parts of the same record
# article, id 12
metadata:
    title: blah

with mapping referenced article would look like (mapping: {key: 'metadata.title', target: 'title'}):

# dataset:
metadata:
    articles:
    - id: 12
      @v: 1
      title: blah

With Invenio PID relation, it would be:

# dataset:
metadata:
    articles:
    - id: 12
      "@v": 1
      metadata:
        title: blah

Validation

This module provides a marshmallow validator for date strings.

Config

Provides interface and definitions for loading preconfigured permission sets to service config.

ICU sort and suggestions

To use ICU sort and suggestion custom fields, provide the following configuration to oarepo-model-builder (or put this stuff to your custom superclasses).

  record:
    imports:
      - import: invenio_records_resources.records.api.Record
        alias: InvenioRecord
      - import: oarepo_runtime.records.SystemFieldDumperExt
      - import: oarepo_runtime.records.icu.ICUSortField
      - import: oarepo_runtime.records.icu.ICUSuggestField
    extra-code: |-2
          # extra custom fields for testing ICU sorting and suggesting
          sort = ICUSortField(source_field="metadata.title")
          suggest = ICUSuggestField(source_field="metadata.title")
  search-options:
    base-classes:
      - I18nSearchOptions
    imports:
      - import: oarepo_runtime.services.icu.I18nSearchOptions
      - import: oarepo_runtime.services.icu.ICUSuggestParser
      - import: oarepo_runtime.services.icu.ICUSortOptions
    sort-options-field: extra_sort_options
    extra-code: |-2
          suggest_parser_cls = ICUSuggestParser("records2")
          sort_options = ICUSortOptions("records2")

  record-dumper:
    extensions:
      - SystemFieldDumperExt()

Run invenio oarepo cf init to initialize custom fields, invenio oarepo index reindex if you already have data inside the repository and from this moment on, /records?sort=title and /records?suggest=abc should work

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

oarepo-runtime-1.4.32.tar.gz (52.5 kB view details)

Uploaded Source

Built Distribution

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

oarepo_runtime-1.4.32-py3-none-any.whl (87.3 kB view details)

Uploaded Python 3

File details

Details for the file oarepo-runtime-1.4.32.tar.gz.

File metadata

  • Download URL: oarepo-runtime-1.4.32.tar.gz
  • Upload date:
  • Size: 52.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for oarepo-runtime-1.4.32.tar.gz
Algorithm Hash digest
SHA256 1d54fd0ea809f6af368b1a9177925d3186104680afb75386c6570f53b6e6f5cc
MD5 729746099376c57a3a04463da87b3cdc
BLAKE2b-256 0f624204699ff637021c3439376461e7d11792c0b2375fb8a52ce398bc28a2b3

See more details on using hashes here.

File details

Details for the file oarepo_runtime-1.4.32-py3-none-any.whl.

File metadata

File hashes

Hashes for oarepo_runtime-1.4.32-py3-none-any.whl
Algorithm Hash digest
SHA256 dccda7b24d350562354763d6fdf99a407e0faa8b0ad45aca4d9a7d43955e24a9
MD5 024311e170fce7318a3dcef4699f81a4
BLAKE2b-256 e372eaa8cc0cc9a59592a840fe854004f3c5fd94f209f3731eba6d674441428c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page