fabiobatalha / crossrefapi

A python library that implements the Crossref API.
BSD 2-Clause "Simplified" License
265 stars 44 forks source link

Add ability to specify request parameters to "all" function. #59

Closed MartinPaulEve closed 1 year ago

MartinPaulEve commented 1 year ago

At present, the request parameters are always set to an empty dictionary. However, the Crossref Labs API, which provides additional experimental functionality, has various options that are controlled by querystring parameters. It is, therefore, useful to have a way to set this as it allows for the usage of these aternative API endpoints.

An example usage might be:

members = Members(
            etiquette=my_etiquette,
        )
crossref.restful.API = "api.labs.crossref.org"
members.ENDPOINT = "members"

members.all(request_params={"rows":"all", "simple":"True"})

More about the Crossref Labs API can be found at https://api.labs.crossref.org and https://api.labs.crossref.org/docs.

Disclaimer: the author of this commit, Martin Paul Eve, works for Crossref. This does not imply correctness or safety of the submitted code, which is subject to the disclaimers of the LICENSE file.