Python library wrapping and enhancing the Invenio RDM REST API.

Overview

Iridium

Project status Test Coverage Docs

The metal Iridium is used to refine and enhance metal alloys. Similarly, this package provides an enhanced coating around the Invenio RDM APIs and is a central piece of the Ardiem platform.

It provides:

  • a lower-level Python API wrapping the public Invenio RDM backend APIs

  • a higher-level object-oriented convenience API (TODO)

  • a JSON Schema based concept of "dataset profiles" for Invenio records (TODO)

  • transparent support for storage and retrieval of additional validated metadata (TODO)

Development

This project uses Poetry for dependency management.

Clone this repository and run poetry install.

Run pre-commit install after cloning to enable pre-commit to enforce the required linting hooks.

Run pytest before merging your changes to make sure you did not break anything.

To generate documentation, run pdoc --html -o docs python_app_template.

To check coverage, use pytest --cov.

Acknowledgements

HMC Logo    FZJ Logo

This project was developed at the Institute for Materials Data Science and Informatics (IAS-9) of the Jülich Research Center and funded by the Helmholtz Metadata Collaboration (HMC), an incubator-platform of the Helmholtz Association within the framework of the Information and Data Science strategic initiative.

Comments
  • Tests fail when running against invenioRDM-v8

    Tests fail when running against invenioRDM-v8

    $ poetry run pytest
    ================================================================================================================================================= test session starts =================================================================================================================================================
    platform linux -- Python 3.9.2, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
    rootdir: /home/chriz/rz/code/invenio/repos/iridium/iridium, configfile: pyproject.toml
    plugins: anyio-3.5.0, cov-3.0.0, dotenv-0.5.2
    collected 14 items                                                                                                                                                                                                                                                                                                    
    
    tests/test_api.py EEE                                                                                                                                                                                                                                                                                           [ 21%]
    tests/test_generic.py ...                                                                                                                                                                                                                                                                                       [ 42%]
    tests/test_inveniordm_api.py EEEEEE                                                                                                                                                                                                                                                                             [ 85%]
    tests/test_utils.py ..                                                                                                                                                                                                                                                                                          [100%]
    
    ======================================================================================================================================================= ERRORS ========================================================================================================================================================
    _________________________________________________________________________________________________________________________________________ ERROR at setup of test_vocab_query __________________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    ____________________________________________________________________________________________________________________________________ ERROR at setup of test_readonly_fields_draft _____________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    ________________________________________________________________________________________________________________________________________ ERROR at setup of test_create_record _________________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    _________________________________________________________________________________________________________________________________________ ERROR at setup of test_vocabularies _________________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    ________________________________________________________________________________________________________________________________________ ERROR at setup of test_record_queries ________________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    __________________________________________________________________________________________________________________________________________ ERROR at setup of test_new_draft ___________________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    ______________________________________________________________________________________________________________________________________ ERROR at setup of test_draft_from_record _______________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    _____________________________________________________________________________________________________________________________________ ERROR at setup of test_version_from_record ______________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    _________________________________________________________________________________________________________________________________________ ERROR at setup of test_access_links _________________________________________________________________________________________________________________________________________
    
        @pytest.fixture(scope="session")
        def rdm():
            """Return an low-level API instance configured from environment variables."""
            cl = InvenioRDMClient.from_env(verify=False)
        
            # clean up all drafts from possible previous unclean runs
            if cl.connected():
    >           drafts = cl.query.records(user=True, q="is_published:false")
    
    tests/conftest.py:94: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    iridium/inveniordm/__init__.py:202: in records
        res.parse_hits(Record)
    iridium/inveniordm/models/query.py:135: in parse_hits
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/query.py:135: in <listcomp>
        self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
    iridium/inveniordm/models/base.py:66: in parse_obj
        return cast(cls, super().parse_obj(val, *args, **kwargs))
    pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
        ???
    iridium/inveniordm/models/base.py:29: in __init__
        super().__init__(*args, **kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    >   ???
    E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
    E   is_draft
    E     extra fields not permitted (type=value_error.extra)
    
    pydantic/main.py:406: ValidationError
    =============================================================================================================================================== short test summary info ===============================================================================================================================================
    ERROR tests/test_api.py::test_vocab_query - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_api.py::test_readonly_fields_draft - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_api.py::test_create_record - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_inveniordm_api.py::test_vocabularies - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_inveniordm_api.py::test_record_queries - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_inveniordm_api.py::test_new_draft - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_inveniordm_api.py::test_draft_from_record - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_inveniordm_api.py::test_version_from_record - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ERROR tests/test_inveniordm_api.py::test_access_links - pydantic.error_wrappers.ValidationError: 1 validation error for Record
    ============================================================================================================================================= 5 passed, 9 errors in 1.90s =============================================================================================================================================
    

    Looks like, there is an validation error. ;)

    Maybe related: https://inveniordm.docs.cern.ch/releases/versions/version-v8.0.0/#my-dashboard

    This also means we have changed the URL endpoint of the uploads page from `/uploads` to `/me/uploads` so that we can later add both `/me/communities` and `/me/requests`.
    

    Edit: this seems to be an internal endpoint not an Rest-Api url-change.

    opened by chriz-uniba 6
  • pdoc --html flag not available.

    pdoc --html flag not available.

    Maybe my setup is outdated but for me this command doesn't run through:

    Error

    https://github.com/Materials-Data-Science-and-Informatics/iridium/blob/4d357dc9d61aebfedd3c3e6a6b6451798c2c7122/README.md?plain=1#L92

    $ pdoc --html -o docs iridium
    usage: pdoc [-o DIR] [-d {google,numpy,restructuredtext}] [-e module=url] [--footer-text TEXT] [--logo URL] [--logo-link URL] [--math | --no-math] [--search | --no-search] [--show-source | --no-show-source] [-t DIR] [-h HOST] [-p PORT] [-n] [--help] [--version] [module ...]
    pdoc: error: unrecognized arguments: --html
    

    Setup

    $ pdoc --version
    pdoc: 8.3.0
    Python: 3.9.2
    Platform: Linux-5.10.0-11-amd64-x86_64-with-glibc2.31
    

    Working command

    $ pdoc -o docs iridium
    

    Creates

    .
    ├── index.html
    ├── iridium
    │   ├── api.html
    │   ├── generic.html
    │   ├── inveniordm
    │   │   ├── models
    │   │   │   ├── base.html
    │   │   │   ├── biblio.html
    │   │   │   ├── query.html
    │   │   │   └── technical.html
    │   │   └── models.html
    │   ├── inveniordm.html
    │   ├── pprint.html
    │   ├── query.html
    │   ├── record.html
    │   └── util.html
    ├── iridium.html
    └── search.js
    
    3 directories, 15 files
    

    Do we need to fix the Readme, or do I need to fix my setup? If it is my setup, let me know what is needed (and maybe add this to the Readme, too). ;)

    opened by chriz-uniba 1
  • Add new features added in v8

    Add new features added in v8

    For example:

    • [ ] https://inveniordm.web.cern.ch//api/names - https://inveniordm.docs.cern.ch/customize/vocabularies/names/ - https://github.com/inveniosoftware/rfcs/blob/master/rfcs/rdm-0054-vocabulary-names.md#rest-api

    If I find more, I will try to update this issue.

    opened by chriz-uniba 0
  • Improvement of vocabulary-tests needed?

    Improvement of vocabulary-tests needed?

    The tests for vocabularies provided here: https://github.com/Materials-Data-Science-and-Informatics/iridium/blob/4d357dc9d61aebfedd3c3e6a6b6451798c2c7122/tests/test_inveniordm_api.py#L23-L50

    are only working on instances where the vocabularies aren't adjusted. For example, a freshly installed instance.

    It is expected and wanted behaviour that vocabularies are adapted and changed: https://inveniordm.docs.cern.ch/customize/vocabularies/ Our instance, for example, has already some other subjects and we are working on different record-types.

    I wonder whether the current tests need more improvement or whether we want to limit these tests down to a 'untouched' vocabularies folder and we expect the user to disable or adjust these tests for their own instances.

    opened by chriz-uniba 1
  • Wrong documentation for delete method?

    Wrong documentation for delete method?

    https://github.com/Materials-Data-Science-and-Informatics/iridium/blob/4d357dc9d61aebfedd3c3e6a6b6451798c2c7122/iridium/inveniordm/init.py#L223-L242

    In line 236 I would expect some 'delete' information. Something like "Delete information about access link for record."?

    opened by chriz-uniba 2
Owner
Materials Data Science and Informatics
Materials Data Science and Informatics
A Python library wrapping the iFixit (Dozuki) API.

A Python library wrapping the iFixit API. Status Working, but incomplete. Fully tested and documented. Hacking I highly recommend using virtualenv: [$

James Pearson Hughes 13 May 24, 2021
Gdrive-python: A wrapping module in python of gdrive

gdrive-python gdrive-python is a wrapping module in python of gdrive made by @pr

Vittorio Pippi 3 Feb 19, 2022
ToqueIO Nuke tools - A collection of tools designed to assist in enhancing your workflows within nuke

ToqueIO Nuke tools - A collection of tools designed to assist in enhancing your workflows within nuke

null 4 Feb 19, 2022
NiceHash Python Library and Command Line Rest API

NiceHash Python Library and Command Line Rest API Requirements / Modules pip install requests Required data and where to get it Following data is nee

Ashlin Darius Govindasamy 2 Jan 2, 2022
NiceHash Python Library and Command Line Rest API

NiceHash Python Library and Command Line Rest API Requirements / Modules pip install requests Required data and where to get it Following data is nee

Ashlin Darius Govindasamy 2 Jan 2, 2022
A Python Library to interface with Flickr REST API, OAuth & JSON Responses

Python-Flickr Python-Flickr is A Python library to interface with Flickr REST API & OAuth Features Photo Uploading Retrieve user information Common Fl

Mike Helmick 40 Sep 25, 2021
A Python Library to interface with Tumblr v2 REST API & OAuth

Tumblpy Tumblpy is a Python library to help interface with Tumblr v2 REST API & OAuth Features Retrieve user information and blog information Common T

Mike Helmick 125 Jun 20, 2022
Python library for interacting with the Wunderlist 2 REST API

Overview Wunderpy2 is a thin Python library for accessing the official Wunderlist 2 API. What does a thin library mean here? Only the bare minimum of

mieubrisse 24 Dec 29, 2020
TM1py is a Python package that wraps the TM1 REST API in a simple to use library.

By wrapping the IBM Planning Analytics (TM1) REST API in a concise Python framework, TM1py facilitates Python developments for TM1. Interacting with T

Cubewise CODE 147 Dec 15, 2022
A client library for the REST API of DocuWare's DMS

docuware-client This is a client library for the REST API of DocuWare DMS. Since DocuWare's documentation regarding the REST API is very sparse (at th

Stefan Schönberger 1 Feb 23, 2022
📦 Opensource Python wrapper for Hiven's REST and WebSocket API

hiven.py ?? Opensource Python wrapper for Hiven's REST and WebSocket API Installation pip install -U hiven.py Usage hiven.py is currently under devel

Kevin Thomas 3 Sep 3, 2021
A very simple Salesforce.com REST API client for Python

Simple Salesforce Simple Salesforce is a basic Salesforce.com REST API client built for Python 3.5, 3.6, 3.7 and 3.8. The goal is to provide a very lo

simple salesforce 1.4k Dec 29, 2022
Python bindings for swm-core client REST API

Python bindings for swm-core client REST API Description Sky Port is an universal bus between user software and compute resources. It can also be cons

Sky Workflows 1 Jan 1, 2022
An unofficial Python wrapper for the 'Binance exchange REST API'

Welcome to binex_f v0.1.0 many interfaces are heavily used by myself in product environment, the websocket is reliable (re)connected. Latest version:

DeepLn 2 Jan 5, 2022
pyDuinoCoin is a simple python integration for the DuinoCoin REST API, that allows developers to communicate with DuinoCoin Master Server

PyDuinoCoin PyDuinoCoin is a simple python integration for the DuinoCoin REST API, that allows developers to communicate with DuinoCoin Main Server. I

BackrndSource 6 Jul 14, 2022
Jackrabbit Relay is an API endpoint for stock, forex and cryptocurrency exchanges that accept REST webhooks.

JackrabbitRelay Jackrabbit Relay is an API endpoint for stock, forex and cryptocurrency exchanges that accept REST webhooks. Disclaimer Please note RA

Rose Heart 23 Jan 4, 2023
A discord bot that utilizes Google's Rest API for Calendar, Drive, and Sheets

Bott This is a discord bot that utilizes Google's Rest API for Calendar, Drive, and Sheets. The bot first takes the sheet from the schedule manager in

null 1 Dec 4, 2021
An unofficial API for lyricsfreak.com using django and django rest framework.

An unofficial API for lyricsfreak.com using django and django rest framework.

Hesam Norin 1 Feb 9, 2022
HTTP Calls to Amazon Web Services Rest API for IoT Core Shadow Actions 💻🌐💡

aws-iot-shadow-rest-api HTTP Calls to Amazon Web Services Rest API for IoT Core Shadow Actions ?? ?? ?? This simple script implements the following aw

AIIIXIII 3 Jun 6, 2022