Skip to main content

Python Async Bittrex API Wrapper

This package is used by the Bittrex integration of Home Assistant.

PyPI version Python Tests Upload Python Package codecov

Available functions

The following functions are available:

from aiobittrexapi import Bittrex
api = Bittrex(api_key, api_secret)

api.get_account()
api.get_balances()
api.get_closed_orders()
api.get_markets()
api.get_open_orders()
api.get_tickers()

Example

from aiobittrexapi import Bittrex
from aiobittrexapi.errors import (
    BittrexApiError,
    BittrexResponseError,
    BittrexInvalidAuthentication,
)

import asyncio
from typing import Optional

API_KEY = ""
API_SECRET = ""


async def main(api_key: Optional[str] = None, api_secret: Optional[str] = None):
    if api_key and api_secret:
        api = Bittrex(api_key, api_secret)
    else:
        api = Bittrex()

    try:
        # Get the active markets from Bittrex - works without secret & key
        markets = await api.get_markets()
        print(markets)

        # Get the tickers
        tickers = await api.get_tickers()
        print(tickers)

        # Get your account data - requires secret & key
        account = await api.get_account()
    except BittrexApiError as e:
        print(e)
    except BittrexResponseError as e:
        print("Invalid response:", e)
    except BittrexInvalidAuthentication:
        print("Invalid authentication. Please provide a correct API Key and Secret")
    else:
        print(account)
    finally:
        await api.close()


if __name__ == "__main__":
    loop = asyncio.get_event_loop()

    if API_KEY and API_SECRET:
        loop.run_until_complete(main(API_KEY, API_SECRET))
    else:
        loop.run_until_complete(main())

Feedback & Pull Requests

All feedback and Pull Requests are welcome!

Development

Don't forget to create your venv

python3 -m venv venv
source venv/bin/activate

Metadata

Release files for aiobittrexapi 1.4.0

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

Source distribution (sdist)

Source distribution for aiobittrexapi 1.4.0
File Size Uploaded
aiobittrexapi-1.4.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiobittrexapi 1.4.0
File Interpreter ABI Platform
aiobittrexapi-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / aiobittrexapi-1.4.0.tar.gz

Download URL aiobittrexapi-1.4.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fb974a8e80c3587f86b6a09975070a88bdabed4b15bd211ba7850c9b87fc44d6
BLAKE2b-256 checksum
How to use checksums
23dc1da24bb9de81e7b5644bbab019051aa87cd36097a6e3bb8b123740fea590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

Release files / aiobittrexapi-1.4.0-py3-none-any.whl

Download URL aiobittrexapi-1.4.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b02b9bf9bd79355a932301e0d436990b9dde522515e09f71f994880aa5be31a
BLAKE2b-256 checksum
How to use checksums
4fb3d15ed1a121e9b34b476eb6804e12bbd56642cc89b2135cf130fde2d81426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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