Skip to content

Cordra client#10

Open
SvenPVoigt wants to merge 12 commits intousnistgov:mainfrom
SvenPVoigt:cordraClient
Open

Cordra client#10
SvenPVoigt wants to merge 12 commits intousnistgov:mainfrom
SvenPVoigt:cordraClient

Conversation

@SvenPVoigt
Copy link
Contributor

Changes to existing code:

  • the request response object handler now converts non-json responses to content - a bytes object. This allows us to handle binary files like images
  • the find function now supports pageNum and pageSize parameters
  • all of the functions now accept arbitrary kwargs which will be used to support requests kwargs in the future

New functionality:

  • A CordraClient object which maintains a continuous connection for a user and supports all CRUD operations of the existing code
    • Multiple instances of CordraClient can run at the same time allowing multiple users to be making requests. May be useful if cordrapy is used as part of some python application which allows multiple users to be using the application at the same time (ie some django web app).
  • Tests. Current tests include CRUD tests for CordraClient

Future functionality:

  • Tests do not support deletion using jsonPointer as this is currently broken in the Cordra HTTP REST API. will include tests once Cordra is updated.
  • CordraObject and Token are awkwardly placed in the cordra.cordra module and act as containers for functions since they only contain staticmethods. They are imported directly in init to avoid the awkwardness and available to import directly from cordra. For these reasons, they would ideally be redesigned as modules. Added deprecate warnings to inform users that these may be reorganized as submodules in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant