oarepo-runtime


Nameoarepo-runtime JSON
Version 1.5.86 PyPI version JSON
download
home_pageNone
SummaryA set of runtime extensions of Invenio repository
upload_time2025-01-29 11:59:43
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```yaml
# article, id 12
metadata:
    title: blah
```

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

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

With Invenio PID relation, it would be:

```yaml
# 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).

```yaml
  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

# Command-line utils

## `invenio oarepo version`

Prints a json with versions of all installed packages. Format:

```json
{
   "package_name": "package_version",
   "package_name2": "package_version2",
   ...
}
```

## `invenio oarepo check`

Checks the repository if it has access to all infrastructure components
and that they have been initialized correctly.

Call as `invenio oarepo check -` or `invenio oarepo check <output-file>`.
Will print/write to file a json with the following format:

```json5
{
  "db": "ok|connection_error|not_initialized|migration_pending",
  "opensearch": "ok|connection_error|index_missing:<index_name>",
  "files": "ok|db_connection_error|default_location_missing|bucket_does_not_exist:<bucket_name>|db_error",
  "mq": "ok|connection_error|mq_error",
  "cache": "ok|connection_error|cache_error|cache_exception", 
  "configuration": {
     // contains the configuration from the flask app
     "key": "value",
     "key2": "value2",
     ...
  }
}
```
```json

```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "oarepo-runtime",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/33/14/1996c015004e61d91a31aba461f558062c56c06e9b99b1c0a8b9ed66aa77/oarepo_runtime-1.5.86.tar.gz",
    "platform": null,
    "description": "# OARepo runtime\n\nThe base of `invenio oarepo` client and a set of classes/functions that help with code-generated features:\n\n## Custom fields\n\nProvides support for custom fields identification and iteration and `invenio oarepo cf init` \ninitialization tool for customfields.\n\n## Expansions\n\nProvides expandable field implementation and service mixin for referenced record (in case you do not want to use relations).\n\n## Facets\n\nAn implementation of nested labeled facet.\n\n## i18n\n\nValidator for language codes.\n\n## Relations\n\nReplacement of Invenio relations. Fixes the following issues:\n\n1. Invenio relations can occur only on specific paths and for each pattern, different class must be used\n   (Relation, ListRelation, NestedListRelation)\n2. PID Cache is isolated per request, not set directly on field\n3. Allows to map keys - A key from related object can be renamed/remapped to a different key/path\n4. Provides classes to reference parts of the same record\n\n```yaml\n# article, id 12\nmetadata:\n    title: blah\n```\n\nwith mapping referenced article would look like (mapping: `{key: 'metadata.title', target: 'title'}`):\n\n```yaml\n# dataset:\nmetadata:\n    articles:\n    - id: 12\n      @v: 1\n      title: blah\n```\n\nWith Invenio PID relation, it would be:\n\n```yaml\n# dataset:\nmetadata:\n    articles:\n    - id: 12\n      \"@v\": 1\n      metadata:\n        title: blah\n```\n\n## Validation\n\nThis module provides a marshmallow validator for date strings.\n\n## Config\n\nProvides interface and definitions for loading \npreconfigured permission sets to service config.\n\n## ICU sort and suggestions\n\nTo use ICU sort and suggestion custom fields, provide the following configuration\nto `oarepo-model-builder` (or put this stuff to your custom superclasses).\n\n```yaml\n  record:\n    imports:\n      - import: invenio_records_resources.records.api.Record\n        alias: InvenioRecord\n      - import: oarepo_runtime.records.SystemFieldDumperExt\n      - import: oarepo_runtime.records.icu.ICUSortField\n      - import: oarepo_runtime.records.icu.ICUSuggestField\n    extra-code: |-2\n          # extra custom fields for testing ICU sorting and suggesting\n          sort = ICUSortField(source_field=\"metadata.title\")\n          suggest = ICUSuggestField(source_field=\"metadata.title\")\n  search-options:\n    base-classes:\n      - I18nSearchOptions\n    imports:\n      - import: oarepo_runtime.services.icu.I18nSearchOptions\n      - import: oarepo_runtime.services.icu.ICUSuggestParser\n      - import: oarepo_runtime.services.icu.ICUSortOptions\n    sort-options-field: extra_sort_options\n    extra-code: |-2\n          suggest_parser_cls = ICUSuggestParser(\"records2\")\n          sort_options = ICUSortOptions(\"records2\")\n\n  record-dumper:\n    extensions:\n      - SystemFieldDumperExt()\n```\n\nRun `invenio oarepo cf init` to initialize custom fields,\n`invenio oarepo index reindex` if you already have data \ninside the repository and from this moment on, \n`/records?sort=title` and `/records?suggest=abc` should work\n\n# Command-line utils\n\n## `invenio oarepo version`\n\nPrints a json with versions of all installed packages. Format:\n\n```json\n{\n   \"package_name\": \"package_version\",\n   \"package_name2\": \"package_version2\",\n   ...\n}\n```\n\n## `invenio oarepo check`\n\nChecks the repository if it has access to all infrastructure components\nand that they have been initialized correctly.\n\nCall as `invenio oarepo check -` or `invenio oarepo check <output-file>`.\nWill print/write to file a json with the following format:\n\n```json5\n{\n  \"db\": \"ok|connection_error|not_initialized|migration_pending\",\n  \"opensearch\": \"ok|connection_error|index_missing:<index_name>\",\n  \"files\": \"ok|db_connection_error|default_location_missing|bucket_does_not_exist:<bucket_name>|db_error\",\n  \"mq\": \"ok|connection_error|mq_error\",\n  \"cache\": \"ok|connection_error|cache_error|cache_exception\", \n  \"configuration\": {\n     // contains the configuration from the flask app\n     \"key\": \"value\",\n     \"key2\": \"value2\",\n     ...\n  }\n}\n```\n```json\n\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A set of runtime extensions of Invenio repository",
    "version": "1.5.86",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1d37360ed656ae326b664fc05edbba778f8b492b608dad226c6fe4aa83213d10",
                "md5": "02c700c9465ecbd474d3280b44935518",
                "sha256": "12a2b617c98ea00aef0c1744624e8b1bb881637eb1d8043b80205f613d50b1bb"
            },
            "downloads": -1,
            "filename": "oarepo_runtime-1.5.86-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "02c700c9465ecbd474d3280b44935518",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 121042,
            "upload_time": "2025-01-29T11:59:42",
            "upload_time_iso_8601": "2025-01-29T11:59:42.309088Z",
            "url": "https://files.pythonhosted.org/packages/1d/37/360ed656ae326b664fc05edbba778f8b492b608dad226c6fe4aa83213d10/oarepo_runtime-1.5.86-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "33141996c015004e61d91a31aba461f558062c56c06e9b99b1c0a8b9ed66aa77",
                "md5": "c52d37c9a9666d879e76c42e58c634a2",
                "sha256": "dbd2f24a5f69ed9e7e8744195675e18b553da1d334840fb3a0ae91c5f2eede42"
            },
            "downloads": -1,
            "filename": "oarepo_runtime-1.5.86.tar.gz",
            "has_sig": false,
            "md5_digest": "c52d37c9a9666d879e76c42e58c634a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 81174,
            "upload_time": "2025-01-29T11:59:43",
            "upload_time_iso_8601": "2025-01-29T11:59:43.672135Z",
            "url": "https://files.pythonhosted.org/packages/33/14/1996c015004e61d91a31aba461f558062c56c06e9b99b1c0a8b9ed66aa77/oarepo_runtime-1.5.86.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-29 11:59:43",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "oarepo-runtime"
}
        
Elapsed time: 0.49370s