Hi there,
I'm in the planning stages of writing an open source Python client to access the OPS. I've already had a lot of experience dealing with the throttling aspect of the API from the previous versions. I've studied the new quota system and will incorporate that into the client as well.
Was wondering if there are Python users out there who are:
1. Willing to contribute development to the package
2. Willing to validate the public interface for the package
3. Willing to use the package once it's done (planning to have at least a usable version by the end of January)
--
George
Anyone interested in working on a Python client?
Re: Anyone interested in working on a Python client?
I've made pretty good progress so far. If anyone is interested at taking a look at the client interface or contributing, I'd appreciate any feedback.
The project is hosted on GitHub, since the forum won't let me post a like, you'll have to Google for "github python-epo-ops-client".
The project is hosted on GitHub, since the forum won't let me post a like, you'll have to Google for "github python-epo-ops-client".
Re: Anyone interested in working on a Python client?
OK, python-epo-ops-client has officially been release. Take a look and let me know what you think. Better yet, use it.
The project is hosted at https://github.com/55minutes/python-epo-ops-client
Code: Select all
pip install python-epo-ops-client
Re: Anyone interested in working on a Python client?
Hi gsong,
thanks for this. am interested in this package. Will provide initial feedback shortly.
thanks for this. am interested in this package. Will provide initial feedback shortly.
Re: Anyone interested in working on a Python client?
Thanks so much George for creating this project and sharing it. I'm trying to get started with it and am having trouble downloading biblio data. I seem to be able to authenticate as I can get an access token, but every time I try to pull a record I get a 404 error. Any guidance would be greatly appreciated.
Code: Select all
import epo_ops
registered_client = epo_ops.RegisteredClient(key='hidden', secret='hidden')
registered_client.access_token # To see the current token
response = registered_client.published_data(
reference_type = 'publication',
input = epo_ops.models.Docdb('1000000', 'EP', 'A1')
)
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-15-147eba2ea796> in <module>()
5 response = registered_client.published_data(
6 reference_type = 'publication',
----> 7 input = epo_ops.models.Docdb('1000000', 'EP', 'A1')
8 )
C:\Users\Chris\AppData\Local\Continuum\Miniconda3\lib\site-packages\epo_ops\api.py in published_data(self, reference_type, input, endpoint, constituents)
90 return self._service_request(
91 self.__published_data_path__, reference_type, input, endpoint,
---> 92 constituents
93 )
94
C:\Users\Chris\AppData\Local\Continuum\Miniconda3\lib\site-packages\epo_ops\api.py in _service_request(self, path, reference_type, input, endpoint, constituents)
83 self, path, reference_type, input, endpoint, constituents or []
84 )
---> 85 return self.make_request(url, input.as_api_input())
86
87 def published_data(
C:\Users\Chris\AppData\Local\Continuum\Miniconda3\lib\site-packages\epo_ops\api.py in make_request(self, url, data, extra_headers)
165 response = self.check_for_expired_token(response)
166 response = self.check_for_exceeded_quota(response)
--> 167 response.raise_for_status()
168 return response
C:\Users\Chris\AppData\Local\Continuum\Miniconda3\lib\site-packages\requests\models.py in raise_for_status(self)
806
807 if http_error_msg:
--> 808 raise HTTPError(http_error_msg, response=self)
809
810 def close(self):
HTTPError: 404 Client Error: Not Found
Re: Anyone interested in working on a Python client?
@chris1 This was a Windows only bug which was just fixed. Sorry for not identifying it earlier. I'm just not that familiar with Windows.
In any case, the latest version should fix this problem.
In any case, the latest version should fix this problem.