metaodi / sruthi

SRU (Search/Retrieve via URL) client library for Python
MIT License
9 stars 3 forks source link

Add support for additional parameters on the client level #42

Closed tijmenbaarda closed 1 year ago

tijmenbaarda commented 1 year ago

Some SRU interfaces need additional URL parameters to work. This is at least the case for the SRU interface of KB (Netherlands National Library), which needs the parameter x-collection=GGC to work, as here:

http://jsru.kb.nl/sru?version=1.2&operation=searchRetrieve&x-collection=GGC&stylesheet=&recordSchema=dcx&startRecord=1&maximumRecords=10&query=gruninger

This pull request adds support for additional parameters by passing them on to the Client constructor. In a project of the Centre for Digital Humanities of Utrecht University we are using sruthi to create a virtual research environments that lets the user query various library databases, including databases with a SRU API.

An alternative to my approach would be to allow passing additional parameters to the searchretrieve method; however, as far as I have seen so far the additional parameters remain the same across search/retrieve operations.

I have not included a test with fixture for now, because I would first like to hear if you agree with the approach. I have not provided documentation, because I don't see how to fit this into the current readme file. But please let me know if you would like me to.

metaodi commented 1 year ago

I propose a different approach in #44, would that work for you?

tijmenbaarda commented 1 year ago

Closing this pull request because it was superseded by #44.