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.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: woopy-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d3a4369c9da981c0c82ec7479279816258b7ae99539abe19bcfa1ca3f9815517
MD5 2fe1c8210998bfb7254e735c079b19c0
BLAKE2b-256 9645fd2b13e0c60e2031fb89e6959ed300a2285a545668c7c39071c5d9d69fa5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: woopy-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ddbac592c1060e40891fd0b8d2af32ae97eb77fe2748a7e48a4b93117e18daf2
MD5 59e3697d8bea44d6cbd7f678f95d5816
BLAKE2b-256 6c0a22174628d61da9c81387a46b24da6f172d98c596874e986442660c09300a

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