python3-krakenex | REST Exchange API for Kraken.com , Python | REST library

 by   veox Python Version: Current License: Non-SPDX

kandi X-RAY | python3-krakenex Summary

kandi X-RAY | python3-krakenex Summary

python3-krakenex is a Python library typically used in Web Services, REST, Ethereum, Bitcoin applications. python3-krakenex has no bugs, it has no vulnerabilities, it has build file available and it has low support. However python3-krakenex has a Non-SPDX License. You can install using 'pip install python3-krakenex' or download it from GitHub, PyPI.

REST Exchange API for Kraken.com, Python 3
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              python3-krakenex has a low active ecosystem.
              It has 584 star(s) with 225 fork(s). There are 50 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 19 open issues and 80 have been closed. On average issues are closed in 139 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of python3-krakenex is current.

            kandi-Quality Quality

              python3-krakenex has 0 bugs and 8 code smells.

            kandi-Security Security

              python3-krakenex has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              python3-krakenex code analysis shows 0 unresolved vulnerabilities.
              There are 3 security hotspots that need review.

            kandi-License License

              python3-krakenex has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              python3-krakenex releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              python3-krakenex saves you 153 person hours of effort in developing the same functionality from scratch.
              It has 381 lines of code, 19 functions and 14 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed python3-krakenex and discovered the below as its top functions. This is intended to give you an instant insight into python3-krakenex implemented functionality, and help decide if they suit your requirements.
            • Queries the API
            • Make a POST request
            • Create a signature for the given data
            • Generate a nonce
            • Query public method
            • Load key from file
            • Print a line of text
            • Set the JSON options for this request
            • Get trades
            • Convert date to datetime
            • Convert a nix timestamp to a string
            • Return current time
            • Returns the contents of a file
            Get all kandi verified functions for this library.

            python3-krakenex Key Features

            No Key Features are available at this moment for python3-krakenex.

            python3-krakenex Examples and Code Snippets

            Find entry in set of dicts with matching key
            Pythondot img1Lines of Code : 2dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            a = {x for x in assets if assets[x].get('wsname') == 'XBT/USD'}
            
            Find entry in set of dicts with matching key
            Pythondot img2Lines of Code : 12dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            a = []
            
            for x in assets:
                try:
                    if x['wsname']:
                        a.append(x)
                except KeyError:
                    pass
            
            except KeyError as error_info:
                print(error_info)
            
            Kraken API for OHLC data to only append latest entries
            Pythondot img3Lines of Code : 95dot img3License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import time
            import krakenex
            import pandas as pd
            from pykrakenapi import KrakenAPI
            
            api = krakenex.API()
            k = KrakenAPI(api)
            
            # Initial OHLC dataframe
            df, last = k.get_ohlc_data("BCHUSD", ascending=True)
            
            # Infinite loop for additional OHLC 
            PyKrakenAPI KeyError on pd.DataFrame(res['result'][pair])
            Pythondot img4Lines of Code : 19dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            >>> trades = api.query_public("Trades", {'pair': 'XBTUSD', 'since': 1546300800000000000, 'ascending': True})
            >>> print(trades)
            {'error': [], 'result': {'XXBTZUSD': [['3690.90000', '0.00400000', 1546300800.4732, 's', 'l', 
            Python: How to set ticker in krakenex for fetching historical OHLC-data?
            Pythondot img5Lines of Code : 7dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import krakenex
            from pprint import pprint
            
            k = krakenex.API()
            
            pprint(k.query_public('OHLC', {'pair':'XXBTZUSD', 'interval':1440, 'since':1214011560}))
            

            Community Discussions

            QUESTION

            Kraken API 'EAPI:Invalid key' with Python3
            Asked 2019-Feb-25 at 23:49

            I tried making a simple function which makes a HTTP request to Kraken exchange API. The method is private, I am trying to fetch my account balance.

            According to Kraken documentation (https://www.kraken.com/features/api#general-usage):

            HTTP header:

            API-Key = API key

            API-Sign = Message signature using HMAC-SHA512 of (URI path + SHA256(nonce + POST data)) and base64 decoded secret API key

            POST data:

            nonce = always increasing unsigned 64 bit integer

            otp = two-factor password (if two-factor enabled, otherwise not required)

            I tried to make my signature generation similar to the "veox" Python library (available at: https://github.com/veox/python3-krakenex/blob/master/krakenex/api.py).

            I am using Python 3.6.7 on Ubuntu 18.04.

            2FA (otp) is turned on for my account on Kraken exchange, though I am not sure if I need to include in the request.

            I searched stack overflow for the solution, but I can't seem to get anything from the posts available. (Please keep in mind I'm fairly new to Python and Stack Overflow)

            I get 200 response from the server so I am pretty sure the problem is in generating the signature.

            Here is my code (xxx, yyy and zzz variables are purposefully written like that):

            ...

            ANSWER

            Answered 2019-Feb-25 at 23:49

            So I figured out why my code was not working.

            Short answer:
            1. POST data used in the Kraken API call has to be URL encoded. That means that "nonce" and "otp" have to be URL encoded for the API to work properly. I used "urllib.parse.urlencode" method from the "urllib" module to get API to work properly.
            2. Header values have to explicitly be called the same names as in the Kraken API manual.
            Long answer:
            1. This may be because I am a beginner in coding API's, but Kraken API manual does not explicitly state that POST data has to be URL encoded. OTP (2 factor authentication) did not affect my code in this case so I got rid of that part of the POST data in the call.

            In my case, the only POST data I used was the "nonce" value. So for example, if in the above code nonce was equal to

            Source https://stackoverflow.com/questions/54447160

            QUESTION

            Trouble importing module in Python
            Asked 2017-Jul-30 at 21:44
            Versions

            OS: OSX Sierra Python: 3.5

            What am I trying to achieve?

            I'm trying to import krakenex and run it with cmd + b in Sublime Text 3 on OSX.

            What do I expect to happen?

            I expect to be able to run the example open-positions.py (or any other).

            What happens instead?

            When pressing cmd + b, I get
            "import krakenex ImportError: No module named krakenex"

            If I create a new file that just says "print 'hello world'" and then press cmd + b, it does print 'hello world'.

            However, krakenex is not imported when I press cmd + b within open-positions.py.

            The problem is probably very basic. I learned python the day before yesterday, installed Anaconda yesterday, and I have very little experience with APIs. Apologies for the incompetence.

            I downloaded the zip file from https://github.com/veox/python3-krakenex/, extracted it, then ran python3 setup.py install within that extracted directory. I then opened that whole extracted folder with Sublime Text 3. Then, within open-positions.py, if I press cmd + b, I get said error message.

            The full output is

            raceback (most recent call last): File "/Users/Norbert/Downloads/python3-krakenex-master/examples/open-positions.py", line 1, in import krakenex ImportError: No module named krakenex [Finished in 0.1s with exit code 1] [shell_cmd: "python" -u "/Users/Norbert/Downloads/python3-krakenex-master/examples/open-positions.py"] [dir: /Users/Norbert/Downloads/python3-krakenex-master/examples] [path: /usr/bin:/bin:/usr/sbin:/sbin]

            Much appreciated.

            ...

            ANSWER

            Answered 2017-Jul-30 at 21:42

            If I create a new file that just says print 'hello world' and then press cmd + b, it does print hello world.

            Here is your problem. See, your program is written in Python 2. Had you run it in Python 3, it would say SyntaxError: Missing parentheses in call to 'print'.

            You've installed that module into your python3 and are running python2 from ST3.

            Source https://stackoverflow.com/questions/45404945

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install python3-krakenex

            You can install using 'pip install python3-krakenex' or download it from GitHub, PyPI.
            You can use python3-krakenex like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/veox/python3-krakenex.git

          • CLI

            gh repo clone veox/python3-krakenex

          • sshUrl

            git@github.com:veox/python3-krakenex.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link