Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: fixed authors serialization. #1550

Merged

Conversation

alejandromumo
Copy link
Member

@alejandromumo alejandromumo commented Oct 16, 2023

closes https://github.com/zenodo/rdm-project/issues/362

Since we removed HumanName, it is not easy to always extract the authors names "nicely" without implementing something like the library itself...

See some examples for the function below:

gh_data = {
    "name": "Manuel",
    "login": "alejandromumo",
    "company": "CERN"
}

print(serialize_author(gh_data))
# {'person_or_org': {'type': 'personal', 'given_name': 'Manuel', 'family_name': 'Manuel'}, 'affiliations': [{'name': 'CERN'}]}

gh_data = {
    "name": None,
    "login": "alejandromumo",
    "company": None
}

print(serialize_author(gh_data))
# {'person_or_org': {'type': 'personal', 'given_name': 'alejandromumo', 'family_name': 'alejandromumo'}, 'affiliations': [{'name': ''}]}


gh_data = {
    "name": "Costa, Manuel",
    "login": "alejandromumo",
    "company": "CERN"
}

print(serialize_author(gh_data))
# {'person_or_org': {'type': 'personal', 'given_name': 'Manuel', 'family_name': 'Costa'}, 'affiliations': [{'name': 'CERN'}]}


gh_data = {
    "name": "Mr, Da Costa, Manuel Alejandro",
    "login": "alejandromumo",
    "company": "CERN"
}

print(serialize_author(gh_data))
# {'person_or_org': {'type': 'personal', 'given_name': 'Da Costa, Manuel Alejandro', 'family_name': 'Mr'}, 'affiliations': [{'name': 'CERN'}]}

There are some "ugly" scenarios. I opened an issue to improve this when things are calmer and releases not breaking.

@alejandromumo alejandromumo force-pushed the fix_gh_authors_serialization branch from 08524ff to b26bcd4 Compare October 16, 2023 17:33
@kpsherva kpsherva merged commit 13628b3 into inveniosoftware:master Oct 17, 2023
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.

2 participants