***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairnb
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weise, Martin
fairnb
Compare revisions
4437de20eb76edf17b1aa2afce6d962900ed4bb0 to dfcfdb7bab536556900f45de1f142838b61fa3af
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
martin.weise/fairnb
Select target project
No results found
dfcfdb7bab536556900f45de1f142838b61fa3af
Select Git revision
Swap
Target
martin.weise/fairnb
Select target project
martin.weise/fairnb
1 result
4437de20eb76edf17b1aa2afce6d962900ed4bb0
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
add doi retrieval
· f311b6a3
Mahler, Lukas
authored
11 months ago
f311b6a3
Merge branch 'dev'
· c38e10da
Mahler, Lukas
authored
11 months ago
c38e10da
add doi generation for invenio
· dfcfdb7b
Mahler, Lukas
authored
11 months ago
dfcfdb7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fairnb/api/invenio.py
+8
-0
8 additions, 0 deletions
fairnb/api/invenio.py
fairnb/entity/invenio_entity.py
+8
-5
8 additions, 5 deletions
fairnb/entity/invenio_entity.py
with
16 additions
and
5 deletions
fairnb/api/invenio.py
View file @
dfcfdb7b
...
...
@@ -98,6 +98,14 @@ class InvenioRDMConnector:
return
response
def
create_doi
(
self
,
url
:
str
):
response
=
rq
.
post
(
url
,
headers
=
self
.
headers
,
).
json
()
return
response
def
download_file
(
self
,
record_id
:
str
,
filename
:
str
,
out_path
:
pathlib
.
Path
,
expand
:
bool
=
True
):
...
...
This diff is collapsed.
Click to expand it.
fairnb/entity/invenio_entity.py
View file @
dfcfdb7b
...
...
@@ -78,15 +78,18 @@ class InvenioRDMEntity(Entity):
self
.
record_metadata
).
json
()
record_id
=
create_response
[
"
id
"
]
self
.
invenio_manager
.
upload_record
(
dir_path
,
regex
,
only_filename
=
False
if
self
.
location
.
is_dir
()
else
True
)
create_doi_response
=
self
.
invenio_manager
.
connector
.
create_doi
(
create_response
[
"
links
"
][
"
reserve_doi
"
])
uri
=
create_doi_response
[
"
links
"
][
"
doi
"
]
self
.
invenio_manager
.
upload_record
(
dir_path
,
regex
,
only_filename
=
False
if
self
.
location
.
is_dir
()
else
True
)
if
self
.
publish_record
:
publish_response
=
self
.
invenio_manager
.
publish_record
()
uri
=
publish_response
[
"
links
"
][
"
self_doi
"
]
else
:
uri
=
create_response
[
"
links
"
][
"
record
"
]
# Invalid until published
metadata
=
EntityProvenance
.
new
(
name
=
self
.
name
,
...
...
This diff is collapsed.
Click to expand it.