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

Add OpenAlex as repo #44

Open
smierz opened this issue Jul 18, 2022 · 7 comments
Open

Add OpenAlex as repo #44

smierz opened this issue Jul 18, 2022 · 7 comments

Comments

@smierz
Copy link

smierz commented Jul 18, 2022

Hello,
today I saw a tweet on Twitter (https://twitter.com/aarontay/status/1548674479601004545?t=n7WRkMg2ehfhfLnRlXZ-mA&s=19 ) and in the comments it was suggested that Openalex would be a good addition. While OpenAlex is not a repository itself, it is possible to query for works via search terms and if the work is Open Access there may be a link to the pdf included in the metadata which could be used for downloading the paper.

Do you think including OpenAlex would be a good fit?

I would be happy to help/implement the feature.

@aarontaycheehsien
Copy link

Yes, I think the fact that OpenAlex isn't a repository of OA content isn't a problem, since pygetpapers supports Crossref API which also isn't a repository of full text?

@petermr
Copy link
Owner

petermr commented Jul 20, 2022 via email

@ayush4921
Copy link
Collaborator

@smierz Hi! I do think OpenAlex is a great addition to pygetpapers. I played around with OpenAlex and diophila.

It shouldn't be too difficult adding something like diophila to pygetpapers. (habanero was a crossref wrapper that we integrated into pygetpapers).

@smierz
Copy link
Author

smierz commented Jul 22, 2022

Hi @ayush4921 ,
I already looked a bit around your code and you're right, shouldn't be too hard.

One thing that is currently missing in diophila though is the "search" parameter. While you can use a filter that searches the work's title, the search parameter looks into the title and the abstract (see the infobox in the works convenience filter section).
I think this would be the preferred way of searching for a term and then get the papers, so I will add that to diophila beforehand 🙂

@petermr
Copy link
Owner

petermr commented Jul 22, 2022 via email

@ayush4921
Copy link
Collaborator

Hi @ayush4921 , I already looked a bit around your code and you're right, shouldn't be too hard.

One thing that is currently missing in diophila though is the "search" parameter. While you can use a filter that searches the work's title, the search parameter looks into the title and the abstract (see the infobox in the works convenience filter section). I think this would be the preferred way of searching for a term and then get the papers, so I will add that to diophila beforehand 🙂

Sure @smierz! Do ping me once the search functionality has been added!

@smierz
Copy link
Author

smierz commented Jul 31, 2022

Ping! The search parameter is now included in diophila 0.4.0.

Here is a simple script to see how it works (for use in Jupyter notebook)

!pip install diophila

from diophila import OpenAlex
openalex = OpenAlex()

filters = {"is_oa": "true"}
search = '"invasive plant species"'
pages_of_works = openalex.get_list_of_works(filters=filters, search=search, pages=[1])

for page in pages_of_works:        # loop through pages
    print(page['meta']['count'])
    for work in page['results']:   # loop though list of works
        print(work['id'])

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

No branches or pull requests

4 participants