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

[Needs discussion]names: adds logging #357

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jrcastro2
Copy link
Contributor

@jrcastro2 jrcastro2 commented Jul 11, 2024

invenio_vocabularies/cli.py Outdated Show resolved Hide resolved
invenio_vocabularies/cli.py Outdated Show resolved Hide resolved
invenio_vocabularies/config.py Outdated Show resolved Hide resolved
invenio_vocabularies/contrib/names/datastreams.py Outdated Show resolved Hide resolved
invenio_vocabularies/contrib/names/datastreams.py Outdated Show resolved Hide resolved
orcids_to_sync.extend(process_file(f))

def fetch_orcid_data(orcid_to_sync, bucket):
suffix = orcid_to_sync[-3:]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment there explaining it, the ORCiD information is stored in a xml that we can find in a folder which name is the last 3 digits on the orcid. For instance, this ORCiD info "0000-0001-5109-3700" is located in the folder /700/0000-0001-5109-3700.xml

invenio_vocabularies/contrib/names/datastreams.py Outdated Show resolved Hide resolved
invenio_vocabularies/contrib/names/datastreams.py Outdated Show resolved Hide resolved
"OrcidDataSyncReader downloads one file and therefore does not iterate through items"
)

def read(self, item=None, *args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After checking, looks like that this is probably still not cleaned, requires a bit more ❤️ :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it was still a draft PR missing some love as you said. Now it's ready to review, still some improvements can be done such as adding more logging but this is a working MVP IMHO.

setup.cfg Outdated
@@ -32,6 +32,10 @@ install_requires =
invenio-administration>=2.0.0,<3.0.0
lxml>=4.5.0
PyYAML>=5.4.1
awscli>=1.33.23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are all these needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably awscli could be removed but the rest were needed, however due to dependency issues between boto3, botocore and commonmet-py, I have replaced them with s3fs which seems to work as fine.

@jrcastro2 jrcastro2 marked this pull request as ready for review July 19, 2024 07:06
@jrcastro2 jrcastro2 changed the title names: add orcid public data sync [Needs discussion]names: adds logging Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants