Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
acd7c526
Commit
acd7c526
authored
Dec 08, 2020
by
Hervé MENAGER
Browse files
Add a web service that retrieves ORCID account details
WIP on #246
parent
27a7dabf
Pipeline
#42937
failed with stages
in 4 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/ws.py
View file @
acd7c526
...
...
@@ -536,3 +536,13 @@ def get_ligand_id(smiles: str) -> str:
raise
EntryNotFoundError
(
smiles
,
msg
=
str
(
f
"ligand for smiles
{
smiles
}
not found in PDB Ligand"
)
)
def
get_orcid_user_details
(
orcid
:
str
)
->
str
:
endpoint
=
f
"https://pub.orcid.org/v3.0/
{
orcid
}
/person"
resp
=
requests
.
get
(
endpoint
,
headers
=
{
"Accept"
:
"application/json"
},)
data
=
resp
.
json
()
return
{
"first"
:
data
[
"name"
][
"given-names"
][
"value"
],
"last"
:
data
[
"name"
][
"family-name"
][
"value"
],
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment