Package: bitpanda-aio
bitpanda-aio 2.0.2Announcement:bitpanda-aiohas been replaced by a new librarycryptoxlib-aio.cryptoxlib-aiooffers the very same functionality asbitpanda-aiobut on top it provides access to multiple cryptoexchanges and other (mostly technical) new features. You can keep usingbitpanda-aiobut please note no new features/bugfixes will be implemented. We recommend to migrate tocryptoxlib-aio.bitpanda-aiois a Python library providing access toBitpanda Pro API(former Bitpanda Global Exchange). Library implements bitpanda's REST API as well as websockets.bitpanda-aiois designed as an asynchronous library utilizing modern features of Python and of supporting asynchronous libraries (mainlyasync websocketsandaiohttp).For changes seeCHANGELOG.Featuresaccess to complete Bitpanda's REST API (account details, market data, order management, ...) and websockets (account feed, market data feed, orderbook feed, ...)automatic connection management (reconnecting after remote termination, ...)channels bundled in one or multiple websockets processed in parallellean architecture setting ground for the future extensions and customizationsfully asynchronous design aiming for the best performanceInstallationpipinstallbitpanda-aioPrerequisitesDue to dependencies and Python features used by the library please make sure you use Python3.6or3.7.Before starting usingbitpanda-aio, it is necessary to take care of downloading your Bitpanda API key from your Bitpanda Pro account.ExamplesREST APIimportasyncioimportloggingimportdatetimefrombitpanda.BitpandaClientimportBitpandaClientfrombitpanda.PairimportPairfrombitpanda.enumsimportOrderSide,TimeUnitlogger=logging.getLogger("bitpanda")logger.setLevel(logging.DEBUG)logger.addHandler(logging.StreamHandler())asyncdefrun():api_key="<YOUR_API_KEY>"client=BitpandaClient(api_key)print("Account balance:")awaitclient.get_account_balances()print("Account fees:")awaitclient.get_account_fees()print("Account orders:")awaitclient.get_account_orders()print("Account order:")awaitclient.get_account_order("1")print("Create market order:")awaitclient.create_market_order(Pair("BTC","EUR"),OrderSide.BUY,"1")print("Create limit order:")awaitclient.create_limit_order(Pair("BTC","EUR"),OrderSide.BUY,"10","10")print("Create stop loss order:")awaitclient.create_stop_limit_order(Pair("BTC","EUR"),OrderSide.BUY,"10","10","10")print("Delete orders:")awaitclient.delete_account_orders(Pair("BTC","EUR"))print("Delete order:")awaitclient.delete_account_order("1")print("Order trades:")awaitclient.get_account_order_trades("1")print("Trades:")awaitclient.get_account_trades()print("Trade:")awaitclient.get_account_trade("1")print("Trading volume:")awaitclient.get_account_trading_volume()print("Currencies:")awaitclient.get_currencies()print("Candlesticks:")awaitclient.get_candlesticks(Pair("BTC","EUR"),TimeUnit.DAYS,"1",datetime.datetime.now()-datetime.timedelta(days=7),datetime.datetime.now())print("Fees:")awaitclient.get_account_fees()print("Instruments:")awaitclient.get_instruments()print("Order book:")awaitclient.get_order_book(Pair("BTC","EUR"))print("Time:")awaitclient.get_time()awaitclient.close()if__name__=="__main__":asyncio.run(run())WEBSOCKETSimportasyncioimportloggingfrombitpanda.BitpandaClientimportBitpandaClientfrombitpanda.PairimportPairfrombitpanda.subscriptionsimportAccountSubscription,PricesSubscription,OrderbookSubscription,\CandlesticksSubscription,MarketTickerSubscription,CandlesticksSubscriptionParamsfrombitpanda.enumsimportTimeUnitlogger=logging.getLogger("bitpanda")logger.setLevel(logging.DEBUG)logger.addHandler(logging.StreamHandler())asyncdeforder_book_update(response:dict)->None:print(f"Callback{order_book_update.__name__}: [{response}]")asyncdefrun():api_key="<YOUR_API_KEY>"client=BitpandaClient(api_key)# Bundle several subscriptions into a single websocketclient.compose_subscriptions([AccountSubscription(),PricesSubscription([Pair("BTC","EUR")]),OrderbookSubscription([Pair("BTC","EUR")],"50",callbacks=[order_book_update]),CandlesticksSubscription([CandlesticksSubscriptionParams(Pair("BTC","EUR"),TimeUnit.MINUTES,1)]),MarketTickerSubscription([Pair("BTC","EUR")])])# Bundle another subscriptions into a separate websocketclient.compose_subscriptions([OrderbookSubscription([Pair("ETH","EUR")],"50",callbacks=[order_book_update]),])# Execute all websockets asynchronouslyawaitclient.start_subscriptions()awaitclient.close()if__name__=="__main__":asyncio.run(run())All examples can be found inclient-example/client.pyin the GitHub repository.SupportIf you like the library and you feel like you want to support its further development, enhancements and bugfixing, then it will be of great help and most appreciated if you:file bugs, proposals, pull requests, ...spread the worddonate an arbitrary tipBTC: 15JUgVq3YFoPedEj5wgQgvkZRx5HQoKJC4ETH: 0xf29304b6af5831030ba99aceb290a3a2129b993dADA: DdzFFzCqrhshyLV3wktXFvConETEr9mCfrMo9V3dYz4pz6yNq9PjJusfnn4kzWKQR91pWecEbKoHodPaJzgBHdV2AKeDSfR4sckrEk79XRP: rhVWrjB9EGDeK4zuJ1x2KXSjjSpsDQSaU6+ tag599790141ContactIf you feel you want to get in touch, then pleaseuse Github Issues if it is related to the development, orsend an e-mail toAffiliationIn case you are interested in an automated trading bot, check out our other projectcreten.