Git Product home page Git Product logo

Comments (5)

veox avatar veox commented on May 14, 2024

i'm trying to do the following

Do describe (not in code) on what it is you're trying to do - the code shows what you're actually doing.

What is the output of krakenex.version.__version__?

Tentatively an issue with OSX decoding the JSON?.. I.e., system-related, not package-related.

Other than that, the code is likely to fail - in krakencom(), you're accessing cur['c'], where cur is the query response received previously from getEthEur()... As far as I remember, the response doesn't have a 'c' key.

from python3-krakenex.

veox avatar veox commented on May 14, 2024

Does the (updated) depth.py example give this error? (If so, post it here.)

from python3-krakenex.

jacob-roth avatar jacob-roth commented on May 14, 2024

I've been getting this too. Using Mac Sierra 10.12.5, Python3.5, krakenex 0.1.4.

Background on my problem: I'm trying to pull all ticker data for all assetpairs at a particular time. I initialize the API as k and use k.query_public(method="Ticker", req={"pair":pair}) for each pair in a list of assetpairs. Sometimes when I run the request on the entire list of 64 assetpairs (from DASHEUR to XZECZUSD), I receive the following error:

Traceback (most recent call last):
.
.
.
  File "/Users/MYUSER/anaconda/envs/python3/lib/python3.5/site-packages/krakenex/api.py", line 148, in query_public
    return self._query(urlpath, req, conn)
  File "/MYUSER/anaconda/envs/python3/lib/python3.5/site-packages/krakenex/api.py", line 131, in _query
    return json.loads(ret)
  File "/Users/MYUSER/anaconda/envs/python3/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/Users/MYUSER/anaconda/envs/python3/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/MYUSER/anaconda/envs/python3/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

As an aside, the issue of c as a key should be fine according to Kraken's API:

<pair_name> = pair name
a = ask array(, , ),
b = bid array(, , ),
c = last trade closed array(, ),
v = volume array(, <last 24 hours>),
p = volume weighted average price array(, <last 24 hours>),
t = number of trades array(, <last 24 hours>),
l = low array(, <last 24 hours>),
h = high array(, <last 24 hours>),
o = today's opening price

and from my testing of the c key with ticker data, it works except for the above error.

from python3-krakenex.

veox avatar veox commented on May 14, 2024

@jacob-roth See if PR #17 helps with what you describe.

It's available in current master, and release v1.0.0a0 (not on PyPI, though, since alpha).


EDIT: shorten, said wrong version

from python3-krakenex.

veox avatar veox commented on May 14, 2024

In short: the error probably stems from krakenex not (previously) handling a connection error, and passing bogus (non-JSON) response from Connection to API.

Closing as stale.

Request reopen, or open separate issue, if present in latest v1.0.0 alphas.

Otherwise, wait for for v1.0.0 (probably at least a month out); or (if using v0.1.4, which is the current stable ATM) try/except for the JSONDecodeError (ugly and improper, I know - sorry).

from python3-krakenex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.