-
Notifications
You must be signed in to change notification settings - Fork 228
Simplify connection handling (by using requests) #11
Copy link
Copy link
Closed
Labels
Milestone
Description
Current issues are now documented.
To "solve" them, can probably "just give up and use requests", and offload any network issues as "Not My Department".
Need answers:
- Is having a dependency acceptable? (Yes. Otherwise, endless loop of NIH.)
- So far,
krakenexhas had no dependencies other than the "standard library".requestsis ubiquitous, though, and many distributions provide it as a system-level package, which handles dependencies ofrequests(urllib3andchardeton my Arch system, with optionalpysocks). - Building documentation requires
sphinx, which hasrequestsas a dependency.
- So far,
- Should a "unified"
query()be introduced? (No. That can be done independently.)- How should it know if an API method is public or private? (See issue Python methods for corresponding Kraken API methods #40.)
- May maintain a list for one of the two, and default to the other one if not in list; or maintain two lists, and refuse to query if in neither list.
- Currently, the difference is that private methods need to set
API-{Key,Sign}headers, and include a nonce in request data. - It seems that having a nonce is not enforced by Kraken for public queries.
- What should its return format be? (JSON, as now.)
- Whatever
requestsreturns? - JSON, as currently output by
query_{private,public}()?
- Whatever
- How should it know if an API method is public or private? (See issue Python methods for corresponding Kraken API methods #40.)
- Should the return format of
query_{private,public}()remain the same? (Yes - for now, to remain backwards-compatible. Trivial - returnrequest's.json()where appropriate.)- Maybe yes, if
query()is not introduced, or to remain backwards-compatible. - Maybe no, if to be obsoleted or made private; then
query()returns JSON, and these two arequestsobject, verbatim.
- Maybe yes, if
- Should manual connection handling remain possible, or become hidden? (Yes. That's the whole point - give users a non-NIH way of customising the connection.)
requestshandlesKeep-Alive.- Allowing to set
timeout(inConnection.__init__()) may become unnecessary.
Answers may depend on current/planned use cases.
Reactions are currently unavailable