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

Can't make field queries request #150

Closed
wisentini opened this issue Jan 13, 2024 · 2 comments · Fixed by #152
Closed

Can't make field queries request #150

wisentini opened this issue Jan 13, 2024 · 2 comments · Fixed by #152
Labels
Milestone

Comments

@wisentini
Copy link

Environment

Python   3.8.18
habanero 1.2.3

Problem

I can't reproduce the request https://api.crossref.org/works?query.publisher-name=Universidade+Federal+de+Santa+Maria in habanero.

I've tried using both filter and query parameters when calling crossref.works(), but I can't get the same results.

Examples

# I get the error: "requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.crossref.org/works?filter=publisher-name%3AUniversidade+Federal+de+Santa+Maria&rows=1"
crossref.works(filter={'publisher_name': 'Universidade Federal de Santa Maria'}, limit=1)
# This works but I don't get the same results of calling https://api.crossref.org/works?query.publisher-name=Universidade+Federal+de+Santa+Maria
crossref.works(query='"publisher": "Universidade Federal de Santa Maria"', limit=1)

Question

How should I reproduce the request https://api.crossref.org/works?query.publisher-name=Universidade+Federal+de+Santa+Maria in habanero?

@sckott
Copy link
Owner

sckott commented Jan 15, 2024

Thanks for the question @wisentini

Looks like Crossref has added new field queries. Just need to make a change to suppor those, will let you know when it's ready to test

@sckott sckott added this to the v1.2.6 milestone Jan 26, 2024
@sckott sckott added the bug label Jan 26, 2024
sckott added a commit that referenced this issue Jan 26, 2024
sckott added a commit that referenced this issue Jan 26, 2024
@sckott
Copy link
Owner

sckott commented Jan 26, 2024

@wisentini can you reinstall from github and test it out? let me know if it doesn't work for you. you should be able to do:

cr.works(query_publisher_name="Universidade Federal de Santa Maria")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants