Skip to main content

A minimal Python API for WooTrade

Project description

Woopy

Woopy is a minimal Python API for trading on WooTrade. It is a Python interface for the WooTrade API . Woopy is an alternative to python-wootrade, which is computationally intensive and appears unstable at Windows platforms. This has been the mean reason for the development of Woopy.

One of the reasons for the instability of python-wootrade is the unnecessary code complexity, which makes is hard to debug. It seems that python-wootrade is a stripped down version of python-binance. The source code of python-binance is equally complicated.

Woopy avoids all unnecessary complications, which leaves a simple module that is easy to maintain. Woopy has only two dependencies, namely requests and websockets.

Prerequisites

  1. First of all, you need an account at WooTrade.
  2. Next, you need to register your application by creating an API Key and Secret, which can be found at Account > Subaccounts and API.
  3. Then, you fetch your Application ID, wich can be found at Account > Subaccounts and API.
  4. It is preferrable to store the Application ID, API Key and API Secret as environment variables, rather than storing them as plaintext in your source code.

Verify your connection

When you set the WOO_API_KEY, WOO_API_SECRET, and WOO_APPLICATION_ID environment variables, or you pasted your credentials in the source code directly, you can test the module by running

python -m woopy

You should then see a stream of messages containing trade information and private information on your position.

Concepts

There are two ways to communicate with WooTrade, namely via HTTP requests and via websockets.

HTTP

The HTTP requests are rather straightforward and can be called via get(), post(), and delete(). The required arguments can be found in the WooTrade API reference.

Websockets

The websockets interface is implemented as an iterable recv_all(), which requires a dictionary of topics as one of its arguments. The keys of this dictionary are public and private endpoints of WooTrade. The values of this dictionary are their respective topics, as specified by the WooTrade API reference.

The recv_all() iterator handles all connection errors and automatically reconnects to the disconnected websocket. Such disconnects can be caused by an interrupted internet connection, or just when WooTrade decides that the session was long enough.

For simplicity, Woopy assumes static topics, i.e., all topics are known from the start.

Happy trading!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

woopy-1.0.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

woopy-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file woopy-1.0.0.tar.gz.

File metadata

  • Download URL: woopy-1.0.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for woopy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 488e7ff9391162d02cf8f6fca38a64b9db65f074371da37c4b145bbf132de8de
MD5 14c157ad21d3ae936912a253b9177616
BLAKE2b-256 2a33baaa953fcb25dc182324575caab2af9df44e702cf5973480e1d9520865e4

See more details on using hashes here.

File details

Details for the file woopy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: woopy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for woopy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a975f8393e42a0ab3c3c7e14e7910dc1180f62ad1a95f5b6761170b596df83d
MD5 223a565c621c5f1f5ceee531a89a1fa2
BLAKE2b-256 72710a0d6f46c975a000390c7e2389e6c0f036f9c8c6de00517fe7fc9971114b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page