Invenio Research Data Management

repository·master·Indexed 41 days ago

https://github.com/inveniosoftware/invenio-app-rdm

A Research Data Management (RDM) application designed to facilitate the lifecycle of research data. It includes tools for managing static pages, creating application fixtures, rebuilding search indices, and extensive configuration options for Flask, SQLAlchemy, OAI-PMH, and Celery scheduled tasks.

Tokens
6.7K
Snippets
17
Records
34
Agent score
52%

What's inside Invenio RDM

  1. Overview of Invenio App RDM

    master
    Invenio App RDM is a Research Data Management (RDM) application. It provides a platform for managing research data, likely including features for discovery, deposit, and management of research outputs. For detailed technical documentation, guides, and API references, visit the official documentation site.
  2. Set up invenio-app-rdm for local development

    master

    To contribute to invenio-app-rdm, follow these steps to set up a local development environment:

    1. Fork and Clone: Fork the repository on GitHub and clone your fork locally.
    2. Install Dependencies: Install the local copy in editable mode within a virtual environment. You can use uv or pipenv (see specific commands below).
    3. Create a Branch: Create a new branch for your specific bugfix or feature.
    4. Verify Changes: Run the provided test script to ensure your changes pass tests, meet PEP8/PEP257 standards, and pass linting/documentation checks.
    5. Commit and Push: Commit your changes using the project's specific multi-line commit message format and push to your fork.
    6. Submit PR: Open a pull request on GitHub.
    # 1. Clone your fork
    $ git clone git@github.com:your_name_here/invenio-app-rdm.git
    $ cd invenio-app-rdm/
    
    # 2. Install (using uv as an example)
    $ uv venv
    $ uv pip install -e ".[tests,opensearch2]"
    
    # 3. Create branch
    $ git checkout -b name-of-your-bugfix-or-feature
    
    # 4. Run tests
    $ ./run-tests.sh
    
    # 5. Commit with specific format
    $ git add .
    $ git commit -s \
        -m "component: title without verbs" \
        -m "* NEW Adds your new feature." \
        -m "* FIX Fixes an existing issue." \
        -m "* BETTER Improves and existing feature." \
        -m "* Changes something that should not be visible in release notes."
    $ git push origin name-of-your-bugfix-or-feature
  3. Pull Request Guidelines

    master

    Before submitting a pull request, ensure it adheres to the following requirements:

    • Tests: The PR must include tests and must not decrease overall test coverage.
    • Documentation: If new functionality is added, update the documentation. New functionality should be encapsulated in a function with a proper docstring.
    • Python Compatibility: Ensure the code works across all supported Python versions. You can verify supported versions in the project's GitHub Actions workflow: .github/workflows/tests-python.yml.
  4. Configure Invenio App RDM via files or environment variables

    master

    Invenio App RDM acts as a flavor extension that forcefully sets configuration variables for other modules. You can override these settings using:

    1. Configuration file: <virtualenv prefix>/var/instance/invenio.cfg
    2. Environment variables: Prefix the variable name with APP_ (e.g., APP_SECRET_KEY).

    WARNING: Do not install multiple flavor extensions in a single instance, as there is no guarantee of priority.

  5. Configure Invenio-Files-REST and storage

    master

    Manage file uploads and storage settings:

    • FILES_REST_PERMISSION_FACTORY: Function to generate permissions for files (defaults to files_rest_permission_factory which returns Denial(any_user)).
    • FILES_REST_CHECKSUM_VERIFICATION_URI_PREFIXES: List of URI prefixes for files whose checksums should be verified.
    • FILES_REST_DEFAULT_STORAGE_CLASS: Default storage class. Options are:
      • L: Local
      • F: Fetch
      • R: Remote
    • FILES_REST_STORAGE_CLASS_LIST: Mapping of short codes to storage class names.
  6. Override User Dashboard menu items

    master

    You can customize the default user dashboard menu by providing overrides in the USER_DASHBOARD_MENU_OVERRIDES configuration key.

    Supported submenu names for overrides are:

    • uploads
    • communities
    • requests

    Each override is a dictionary containing keys like endpoint, text, and order. Attempting to override a submenu name that does not exist in the default configuration will raise a ValueError.

    app.config["USER_DASHBOARD_MENU_OVERRIDES"] = {
        "uploads": {
            "text": "My Uploads",
            "order": 1
        }
    }
  7. Configure RDM Deposit Form behavior

    master

    Customize the record deposit process:

    • APP_RDM_DEPOSIT_FORM_DEFAULTS: Default values for new records in the deposit UI. Keys are dot-separated paths in the record metadata. Values can be callables for dynamic calculation.
    • APP_RDM_DEPOSIT_FORM_CUSTOM_FIELD_DEFAULTS: Default values for custom fields.
    • APP_RDM_DEPOSIT_FORM_AUTOCOMPLETE_NAMES: Behavior for the creator/contributor autocomplete field. Options:
      • "search" (default): Always show search field and form.
      • "search_only": Only show search field; form appears after selection or manual entry.
      • "off": Only show person form.
    • APP_RDM_DEPOSIT_FORM_QUOTA: Dictionary defining upload limits:
      • maxFiles: Maximum number of files.
      • maxStorage: Maximum storage size.
    • APP_RDM_DEPOSIT_NG_FILES_UI_ENABLED: Boolean to enable the next-generation (NG) Uppy.io-based file uploader.
  8. Configure Citation Styles

    master

    You can manage the available citation styles and the default style used in the application via RDM_CITATION_STYLES and RDM_CITATION_STYLES_DEFAULT. The styles are provided as a list of tuples containing the machine name and the human-readable label.

    RDM_CITATION_STYLES = [
        ("apa", _("APA")),
        ("harvard-cite-them-right", _("Harvard")),
        ("modern-language-association", _("MLA")),
        ("nlm-citation-sequence", _("Vancouver")),
        ("chicago-notes-bibliography", _("Chicago")),
        ("ieee", _("IEEE")),
    ]
    
    RDM_CITATION_STYLES_DEFAULT = "apa"