Skip to main content

woo-python

Python SDK (sync and async) for Woo cryptocurrency exchange with Rest and WS capabilities.

Installation

pip install woo-api

Usage

Sync

from woo import WooSync

def main():
    instance = WooSync({})
    ob =  instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = instance.fetch_balance()
    # order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

main()

Async

import sys
import asyncio
from woo import WooAsync

### on Windows, uncomment below:
# if sys.platform == 'win32':
# 	asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

async def main():
    instance = WooAsync({})
    ob =  await instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = await instance.fetch_balance()
    # order = await instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

    # once you are done with the exchange
    await instance.close()

asyncio.run(main())

Websockets

import sys
from woo import WooWs

### on Windows, uncomment below:
# if sys.platform == 'win32':
# 	asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

async def main():
    instance = WooWs({})
    while True:
        ob = await instance.watch_order_book("BTC/USDC")
        print(ob)
        # orders = await instance.watch_orders("BTC/USDC")

    # once you are done with the exchange
    await instance.close()

asyncio.run(main())

Raw call

You can also construct custom requests to available "implicit" endpoints

        request = {
            'type': 'candleSnapshot',
            'req': {
                'coin': coin,
                'interval': tf,
                'startTime': since,
                'endTime': until,
            },
        }
        response = await instance.public_post_info(request)

Available methods

REST Unified

  • create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params: dict = {})
  • create_market_buy_order_with_cost(self, symbol: str, cost: float, params: dict = {})
  • create_market_sell_order_with_cost(self, symbol: str, cost: float, params: dict = {})
  • create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params: dict = {})
  • create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params: dict = {})
  • create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params: dict = {})
  • fetch_accounts(self, params: dict = {})
  • fetch_balance(self, params: dict = {})
  • fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_convert_currencies(self, params: dict = {})
  • fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params: dict = {})
  • fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_convert_trade(self, id: str, code: Str = None, params: dict = {})
  • fetch_currencies(self, params: dict = {})
  • fetch_deposit_address(self, code: str, params: dict = {})
  • fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_funding_interval(self, symbol: str, params: dict = {})
  • fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_funding_rate(self, symbol: str, params: dict = {})
  • fetch_funding_rates(self, symbols: Strings = None, params: dict = {})
  • fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_leverage(self, symbol: str, params: dict = {})
  • fetch_markets(self, params: dict = {})
  • fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params: dict = {})
  • fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_order_book(self, symbol: str, limit: Int = None, params: dict = {})
  • fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_order(self, id: str, symbol: Str = None, params: dict = {})
  • fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_position(self, symbol: str, params: dict = {})
  • fetch_positions_adl_rank(self, symbols: Strings = None, params: dict = {})
  • fetch_positions(self, symbols: Strings = None, params: dict = {})
  • fetch_status(self, params: dict = {})
  • fetch_ticker(self, symbol: str, params: dict = {})
  • fetch_tickers(self, symbols: Strings = None, params: dict = {})
  • fetch_time(self, params: dict = {})
  • fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_trading_fee(self, symbol: str, params: dict = {})
  • fetch_trading_fees(self, params: dict = {})
  • fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • add_margin(self, symbol: str, amount: float, params: dict = {})
  • cancel_all_orders_after(self, timeout: Int, params: dict = {})
  • cancel_all_orders(self, symbol: Str = None, params: dict = {})
  • cancel_order(self, id: str, symbol: Str = None, params: dict = {})
  • default_network_code_for_currency(self, code: str)
  • describe(self)
  • edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params: dict = {})
  • encode_margin_mode(self, mode: Str)
  • get_asset_history_rows(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • get_currency_from_chaincode(self, networkizedCode: object, currency: object)
  • get_dedicated_network_id(self, currency: object, params: dict)
  • modify_margin_helper(self, symbol: str, amount: float, type: str, params: dict = {})
  • nonce(self)
  • reduce_margin(self, symbol: str, amount: float, params: dict = {})
  • repay_margin(self, code: str, amount: float, symbol: Str = None, params: dict = {})
  • set_leverage(self, leverage: int, symbol: Str = None, params: dict = {})
  • set_position_mode(self, hedged: bool, symbol: Str = None, params: dict = {})
  • set_sandbox_mode(self, enable: bool)
  • transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params: dict = {})
  • withdraw(self, code: str, amount: float, address: str, params: dict = {})

REST Raw

  • v1_pub_get_hist_kline(request)
  • v1_pub_get_hist_trades(request)
  • v1_public_get_info(request)
  • v1_public_get_info_symbol(request)
  • v1_public_get_system_info(request)
  • v1_public_get_market_trades(request)
  • v1_public_get_token(request)
  • v1_public_get_token_network(request)
  • v1_public_get_funding_rates(request)
  • v1_public_get_funding_rate_symbol(request)
  • v1_public_get_funding_rate_history(request)
  • v1_public_get_futures(request)
  • v1_public_get_futures_symbol(request)
  • v1_public_get_orderbook_symbol(request)
  • v1_public_get_kline(request)
  • v1_private_get_client_token(request)
  • v1_private_get_order_oid(request)
  • v1_private_get_client_order_client_order_id(request)
  • v1_private_get_orders(request)
  • v1_private_get_client_trade_tid(request)
  • v1_private_get_order_oid_trades(request)
  • v1_private_get_client_trades(request)
  • v1_private_get_client_hist_trades(request)
  • v1_private_get_staking_yield_history(request)
  • v1_private_get_client_holding(request)
  • v1_private_get_asset_deposit(request)
  • v1_private_get_asset_history(request)
  • v1_private_get_sub_account_all(request)
  • v1_private_get_sub_account_assets(request)
  • v1_private_get_sub_account_asset_detail(request)
  • v1_private_get_sub_account_ip_restriction(request)
  • v1_private_get_asset_main_sub_transfer_history(request)
  • v1_private_get_token_interest(request)
  • v1_private_get_token_interest_token(request)
  • v1_private_get_interest_history(request)
  • v1_private_get_interest_repay(request)
  • v1_private_get_funding_fee_history(request)
  • v1_private_get_positions(request)
  • v1_private_get_position_symbol(request)
  • v1_private_get_client_transaction_history(request)
  • v1_private_get_client_futures_leverage(request)
  • v1_private_post_order(request)
  • v1_private_post_order_cancel_all_after(request)
  • v1_private_post_asset_ltv(request)
  • v1_private_post_asset_internal_withdraw(request)
  • v1_private_post_interest_repay(request)
  • v1_private_post_client_account_mode(request)
  • v1_private_post_client_position_mode(request)
  • v1_private_post_client_leverage(request)
  • v1_private_post_client_futures_leverage(request)
  • v1_private_post_client_isolated_margin(request)
  • v1_private_delete_order(request)
  • v1_private_delete_client_order(request)
  • v1_private_delete_orders(request)
  • v1_private_delete_asset_withdraw(request)
  • v3_public_get_systeminfo(request)
  • v3_public_get_instruments(request)
  • v3_public_get_token(request)
  • v3_public_get_tokennetwork(request)
  • v3_public_get_tokeninfo(request)
  • v3_public_get_markettrades(request)
  • v3_public_get_markettradeshistory(request)
  • v3_public_get_orderbook(request)
  • v3_public_get_kline(request)
  • v3_public_get_klinehistory(request)
  • v3_public_get_futures(request)
  • v3_public_get_fundingrate(request)
  • v3_public_get_fundingratehistory(request)
  • v3_public_get_insurancefund(request)
  • v3_private_get_trade_order(request)
  • v3_private_get_trade_orders(request)
  • v3_private_get_trade_algoorder(request)
  • v3_private_get_trade_algoorders(request)
  • v3_private_get_trade_transaction(request)
  • v3_private_get_trade_transactionhistory(request)
  • v3_private_get_trade_tradingfee(request)
  • v3_private_get_account_info(request)
  • v3_private_get_account_tokenconfig(request)
  • v3_private_get_account_symbolconfig(request)
  • v3_private_get_account_subaccounts_all(request)
  • v3_private_get_account_referral_summary(request)
  • v3_private_get_account_referral_rewardhistory(request)
  • v3_private_get_account_credentials(request)
  • v3_private_get_asset_balances(request)
  • v3_private_get_asset_token_history(request)
  • v3_private_get_asset_transfer_history(request)
  • v3_private_get_asset_wallet_history(request)
  • v3_private_get_asset_wallet_deposit(request)
  • v3_private_get_asset_staking_yieldhistory(request)
  • v3_private_get_futures_positions(request)
  • v3_private_get_futures_leverage(request)
  • v3_private_get_futures_defaultmarginmode(request)
  • v3_private_get_futures_fundingfee_history(request)
  • v3_private_get_spotmargin_interestrate(request)
  • v3_private_get_spotmargin_interesthistory(request)
  • v3_private_get_spotmargin_maxmargin(request)
  • v3_private_get_algo_order_oid(request)
  • v3_private_get_algo_orders(request)
  • v3_private_get_positions(request)
  • v3_private_get_buypower(request)
  • v3_private_get_convert_exchangeinfo(request)
  • v3_private_get_convert_assetinfo(request)
  • v3_private_get_convert_rfq(request)
  • v3_private_get_convert_trade(request)
  • v3_private_get_convert_trades(request)
  • v3_private_post_trade_order(request)
  • v3_private_post_trade_algoorder(request)
  • v3_private_post_trade_cancelallafter(request)
  • v3_private_post_account_tradingmode(request)
  • v3_private_post_account_listenkey(request)
  • v3_private_post_asset_transfer(request)
  • v3_private_post_asset_wallet_withdraw(request)
  • v3_private_post_spotmargin_leverage(request)
  • v3_private_post_spotmargin_interestrepay(request)
  • v3_private_post_futures_defaultmarginmode_reset(request)
  • v3_private_post_isolatedmargin_margin(request)
  • v3_private_post_algo_order(request)
  • v3_private_post_convert_rft(request)
  • v3_private_put_trade_order(request)
  • v3_private_put_trade_algoorder(request)
  • v3_private_put_futures_leverage(request)
  • v3_private_put_futures_positionmode(request)
  • v3_private_put_futures_defaultmarginmode(request)
  • v3_private_put_futures_defaultmarginmode_symbol(request)
  • v3_private_put_order_oid(request)
  • v3_private_put_order_client_client_order_id(request)
  • v3_private_put_algo_order_oid(request)
  • v3_private_put_algo_order_client_client_order_id(request)
  • v3_private_delete_trade_order(request)
  • v3_private_delete_trade_orders(request)
  • v3_private_delete_trade_algoorder(request)
  • v3_private_delete_trade_algoorders(request)
  • v3_private_delete_trade_allorders(request)
  • v3_private_delete_algo_order_order_id(request)
  • v3_private_delete_algo_orders_pending(request)
  • v3_private_delete_algo_orders_pending_symbol(request)
  • v3_private_delete_orders_pending(request)
  • v3_private_delete_asset_wallet_withdraw_withdrawid(request)

WS Unified

  • describe(self)
  • watch_public(self, messageHash: str, message: dict)
  • unwatch_public(self, subHash: str, symbol: Str, topic: str, params: dict = {})
  • watch_order_book(self, symbol: str, limit: Int = None, params: dict = {})
  • un_watch_order_book(self, symbol: str, params: dict = {})
  • fetch_order_book_snapshot(self, client: Client, message: dict, subscription: dict)
  • watch_ticker(self, symbol: str, params: dict = {})
  • un_watch_ticker(self, symbol: str, params: dict = {})
  • watch_tickers(self, symbols: Strings = None, params: dict = {})
  • un_watch_tickers(self, symbols: Strings = None, params: dict = {})
  • watch_bids_asks(self, symbols: Strings = None, params: dict = {})
  • un_watch_bids_asks(self, symbols: Strings = None, params: dict = {})
  • watch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params: dict = {})
  • un_watch_ohlcv(self, symbol: str, timeframe: str = '1m', params: dict = {})
  • watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params: dict = {})
  • un_watch_trades(self, symbol: str, params: dict = {})
  • check_required_uid(self, error=True)
  • authenticate(self, params: dict = {})
  • watch_private(self, messageHash: str, message: dict, params: dict = {})
  • watch_private_multiple(self, messageHashes: list[str], message: dict, params: dict = {})
  • watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • watch_positions(self, symbols: Strings = None, since: Int = None, limit: Int = None, params: dict = {})
  • set_positions_cache(self, client: Client, type: object, symbols: Strings = None)
  • load_positions_snapshot(self, client: Client, messageHash: str)
  • watch_balance(self, params: dict = {})
  • watch_funding_rate(self, symbol: str, params: dict = {})
  • pong(self, client: Client, message: dict)

Contribution

  • Give us a star ⭐
  • Fork and Clone! Awesome
  • Select existing issues or create a new issue.

Metadata

Release files for woo-api 0.0.168

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for woo-api 0.0.168
File Size Uploaded Provenance Actions
woo_api-0.0.168.tar.gz 321.2 kB Without provenance Details for woo_api-0.0.168.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for woo-api 0.0.168
File Interpreter ABI Platform Actions
woo_api-0.0.168-py3-none-any.whl Python 3 none any Details for woo_api-0.0.168-py3-none-any.whl

Total release size: 683.5 kB

Release files / woo_api-0.0.168.tar.gz

Download URL woo_api-0.0.168.tar.gz
Size 321.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8dbdef4cabcf467fdf11f9407d3e88c5029b0eded9f664ae1bed0e9dba8a0cf5
BLAKE2b-256 checksum
How to use checksums
525b66be5351250101fc0ebc81830008ed2a6cb7de934fb03b3e3162ff580899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / woo_api-0.0.168-py3-none-any.whl

Download URL woo_api-0.0.168-py3-none-any.whl
Size 362.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c72dab301fdd5b0ada8e3081e3df81b8f37d5481f241f407a05c8f390bc22034
BLAKE2b-256 checksum
How to use checksums
9898aac5ed014c400db17448ad72785ff387fc159a505cec9d30a9fac185130e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for woo-api 0.0.168

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.168 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page