Jul 07 2018

CoPrA – An Asyncronous Python Websocket Client for Coinbase Pro

I know it’s too much too hope that I have any regular readers, but if you  come here even infrequently you may have noticed it’s been seven months since I last posted. You may even have wondered what I have been up to.  What could’ve possible kept Tony so busy that he would totally ignore his blog for more than half a year? Well, I tell you. Fortnite. I have been busy getting my ass kicked 24-7 by eleven year-olds in Fortnite. It is embarrassing quite honestly.

In between matches, however, I actually have been productive working on intelligent agents for trading cryptocurrency on the Coinbase Pro (formerly GDAX) exchange. While most of the high level code isn’t ready for prime time yet, a good portion of the low level, workhorse code has been road tested and is relatively stable.  Since other developers might find it useful, I’ve decided to begin releasing it into the wild.

This week I released the first of my code: CoPrA, an asyncronous Python WebSocket client.  CoPrA is built on top of the phenomenal Autobahn|Python WebSocket framework.  While it is certainly possible to use Autobahn itself for a Coinbase client, its options are multitudinous and generally more complicated than necessary for most applications.  My goal with CoPrA, therefore, was to simplify the WebSocket interface without sacrificing any of the functionality I need.

I will be following up shortly with a more detailed tutorial for using CoPrA, but if you’d like to take it for a test drive now, you can install it using pip:

$ pip3 install copra

CoPrA can also be installed from source. Either clone the repository from github:

$ git clone https://github.com/tpodlaski/copra

or download the tarball:

$ curl -OL https://github.com/tpodlaski/copra/tarball/master'

Once you’ve downloaded a copy of the source files, you can install CoPrA with:

$ python3 setup.py install

I’m looking for feedback, suggestions, bugs, or any other comments, so please feel free to leave them in the comments below.  Look for another post on CoPrA soon.







Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.