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

Add support for binary zipfiles as results from calls to RetrieveExport. #132

Closed
wants to merge 1 commit into from
Closed

Conversation

TheRealRainerHock
Copy link

Calls to https://api.kraken.com/0/private/RetrieveExport return binary zip archive containing the report. They are returned as a ZipFile.

Additionally plain text (according to the content-type of the result's headers) isn't treated as json either.

Calls to https://api.kraken.com/0/private/RetrieveExport return binary zip archive containing the report. They are returned as a ZipFile.
@veox
Copy link
Owner

veox commented Apr 6, 2021

As mentioned in issue #114, this makes the return type of _query() (and, even worse, query_{private,public}()) vary depending on provided function arguments.

This approach is wholly unacceptable for me - it's ugly and results in bad documentation.

@TheRealRainerHock
Copy link
Author

Sounds reasonable, but at the moment RetrieveExport is the only way to retrieve informations about staking and unstaking funds and the workaround you mentioned in #114 also has flaws. Would you accept a new method def query_private_zip(self, method, data=None, timeout=None)?

@veox
Copy link
Owner

veox commented Apr 8, 2021

Personally, I wouldn't care if the issue hangs indefinitely.

The way I see it, the issue is upstream at Kraken, with their dismal design choice regarding this particular query.

Would you accept a new method def query_private_zip(self, method, data=None, timeout=None)?

I've long resorted to keeping such methods of niche utility in a personal-use ExtendedAPI class, derived from krakenex.API.

What is definitely acceptable is an example of such an approach that would go in the examples directory.

@veox
Copy link
Owner

veox commented Apr 15, 2021

I've added just such an example in examples/retrieve-csv-report.py.

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

Successfully merging this pull request may close these issues.

2 participants