NekUpload.upload package
- class NekUpload.upload.InvenioRDM[source]
Bases:
objectResponsible for InvenioRDM database upload logic.
- create_record(url: str, token: str, file_paths: list[str], metadata: dict[str, Any])[source]
Create a draft record with the files
- Parameters:
url (str) – _description_
token (str) – _description_
file_paths (List[str]) – _description_
metadata (Dict[str,Any]) – _description_
- static download_file(url: str, token: str, record_id: str, filename: str, target_directory: str) str[source]
Downloads a file from a record or draft
- Parameters:
url (str) – _description_
token (str) – _description_
record_id (str) – _description_
filename (str) – _description_
- Returns:
Path to download location
- Return type:
str
- static get_all_community_records(url: str, community_slug: str) list[RecordMetadata][source]
Get all records published in a community
- Parameters:
url (str) – _description_
community_slug (str) – _description_
- Returns:
_description_
- Return type:
list[RecordMetadata]
- static get_all_user_records(url: str, token: str) list[RecordMetadata][source]
Get all records uploaded by user, draft or published.
- Parameters:
url (str) – _description_
token (str) – _description_
- Returns:
_description_
- Return type:
list[RecordMetadata]
- static get_record_metadata(url: str, token: str, record_id: str) RecordMetadata[source]
Get record metadata. Both draft and published
- Parameters:
url (str) – _description_
token (str) – _description_
record_id (str) – _description_
- Returns:
_description_
- Return type:
- submit_to_community(url: str, token: str, community_id: str, extra_comments: list[str] = None)[source]
Submit draft record for community review
- Parameters:
url (str) – _description_
token (str) – _description_
community_id (str) – _description_
- upload_files(url: str, token: str, file_paths: list[str], metadata: dict[str, Any], community_id: str, extra_comments: list[str] = None) None[source]
Upload files to an InvenioRDM repository and submit to community for review. Full workflow.
- Parameters:
url (str) – Base URL to the InvenioRDM repository. For example: “https://my-invenio-rdm.example.com”
token (str) – User access token
file_paths (list[str]) – list of paths of files to be uploaded
metadata (dict[str,Any]) – Metadata to be uploaded
community_id (str) – Invenio community id for upload or slug
Submodules
- NekUpload.upload.exceptions module
- NekUpload.upload.invenio_db module
- NekUpload.upload.invenio_rdm_api module
cancel_review_request()commit_file_upload()create_draft_record()create_new_record_version()delete_draft()delete_review_request()download_draft_file()get_all_user_drafts_and_records()get_community()get_community_records()get_draft_record()get_record()prepare_file_upload()publish_draft()raise_status_error()reserve_doi_draft()submit_record_for_review()submit_record_to_community()update_draft_record()upload_file()