{ "info": { "author": "nardew", "author_email": "bitpanda.aio@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: AsyncIO", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed" ], "description": "# bitpanda-aio\n\n[![](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-365/) [![](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-374/)\n\n`bitpanda-aio` is a Python library providing access to [Bitpanda Global Exchange API](https://developers.bitpanda.com/exchange/). Library implements bitpanda's REST API as well as websockets.\n\n`bitpanda-aio` is designed as an asynchronous library utilizing modern features of Python and of supporting asynchronous libraries (mainly [async websockets](https://websockets.readthedocs.io/en/stable/) and [aiohttp](https://aiohttp.readthedocs.io/en/stable/)).\n\n### Features\n- access to complete Bitpanda's REST API (account details, market data, order management, ...) and websockets (account feed, market data feed, orderbook feed, ...)\n- automatic connection management (reconnecting after remote termination, ...)\n- channels bundled in one or multiple websockets processed in parallel \n- lean architecture setting ground for the future extensions and customizations\n- fully asynchronous design aiming for the best performance\n\n### Installation\n```bash\npip install bitpanda-aio\n```\n\n### Prerequisites\n\nDue to dependencies and Python features used by the library please make sure you use Python `3.6` or `3.7`.\n\nBefore starting using `bitpanda-aio`, it is necessary to take care of:\n1. downloading your Bitpanda API key from your Bitpanda Global Exchange account\n1. generating your certificate that will be used to secure SSL connections. Certificate `certificate.pem` can be generated easily by\n```bash\nopenssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out certificate.pem\n```\n\n### Examples\n#### REST API\n```python\nimport asyncio\nimport pathlib\nimport logging\nimport datetime\n\nfrom bitpanda.BitpandaClient import BitpandaClient\nfrom bitpanda.Pair import Pair\nfrom bitpanda.enums import OrderSide, TimeUnit\n\nlogger = logging.getLogger(\"bitpanda\")\nlogger.setLevel(logging.DEBUG)\nlogger.addHandler(logging.StreamHandler())\n\nasync def run():\n\tcertificate_path = pathlib.Path(__file__).with_name(\"certificate.pem\")\n\tapi_key = \"\"\n\n\tclient = BitpandaClient(certificate_path, api_key)\n\n\tprint(\"Account balance:\")\n\tawait client.get_account_balances()\n\n\tprint(\"Account fees:\")\n\tawait client.get_account_fees()\n\n\tprint(\"Account orders:\")\n\tawait client.get_account_orders()\n\n\tprint(\"Account order:\")\n\tawait client.get_account_order(\"1\")\n\n\tprint(\"Create market order:\")\n\tawait client.create_market_order(Pair(\"BTC\", \"EUR\"), OrderSide.BUY, \"1\")\n\n\tprint(\"Create limit order:\")\n\tawait client.create_limit_order(Pair(\"BTC\", \"EUR\"), OrderSide.BUY, \"10\", \"10\")\n\n\tprint(\"Create stop loss order:\")\n\tawait client.create_stop_limit_order(Pair(\"BTC\", \"EUR\"), OrderSide.BUY, \"10\", \"10\", \"10\")\n\n\tprint(\"Delete orders:\")\n\tawait client.delete_account_orders(Pair(\"BTC\", \"EUR\"))\n\n\tprint(\"Delete order:\")\n\tawait client.delete_account_order(\"1\")\n\n\tprint(\"Order trades:\")\n\tawait client.get_account_order_trades(\"1\")\n\n\tprint(\"Trades:\")\n\tawait client.get_account_trades()\n\n\tprint(\"Trade:\")\n\tawait client.get_account_trade(\"1\")\n\n\tprint(\"Trading volume:\")\n\tawait client.get_account_trading_volume()\n\n\tprint(\"Currencies:\")\n\tawait client.get_currencies()\n\n\tprint(\"Candlesticks:\")\n\tawait client.get_candlesticks(Pair(\"BTC\", \"EUR\"), TimeUnit.DAYS, \"1\", datetime.datetime.now() - datetime.timedelta(days=7), datetime.datetime.now())\n\n\tprint(\"Fees:\")\n\tawait client.get_account_fees()\n\n\tprint(\"Instruments:\")\n\tawait client.get_instruments()\n\n\tprint(\"Order book:\")\n\tawait client.get_order_book(Pair(\"BTC\", \"EUR\"))\n\n\tprint(\"Time:\")\n\tawait client.get_time()\n\n\tawait client.close()\n\nif __name__ == \"__main__\":\n\tasyncio.run(run())\n```\n\n#### WEBSOCKETS\n```python\nimport asyncio\nimport pathlib\nimport logging\n\nfrom bitpanda.BitpandaClient import BitpandaClient\nfrom bitpanda.Pair import Pair\nfrom bitpanda.subscriptions import AccountSubscription, PricesSubscription, OrderbookSubscription, \\\n\tCandlesticksSubscription, MarketTickerSubscription, CandlesticksSubscriptionParams\nfrom bitpanda.enums import TimeUnit\n\nlogger = logging.getLogger(\"bitpanda\")\nlogger.setLevel(logging.DEBUG)\nlogger.addHandler(logging.StreamHandler())\n\nasync def order_book_update(response : dict) -> None:\n\tprint(f\"Callback {order_book_update.__name__}: [{response}]\")\n\nasync def run():\n\tcertificate_path = pathlib.Path(__file__).with_name(\"certificate.pem\")\n\tapi_key = \"\"\n\n\tclient = BitpandaClient(certificate_path, api_key)\n\n\t# Bundle several subscriptions into a single websocket\n\tclient.compose_subscriptions([\n\t\tAccountSubscription(),\n\t\tPricesSubscription([Pair(\"BTC\", \"EUR\")]),\n\t\tOrderbookSubscription([Pair(\"BTC\", \"EUR\")], \"50\", callbacks = [order_book_update]),\n\t\tCandlesticksSubscription([CandlesticksSubscriptionParams(Pair(\"BTC\", \"EUR\"), TimeUnit.MINUTES, 1)]),\n\t\tMarketTickerSubscription([Pair(\"BTC\", \"EUR\")])\n\t])\n\n\t# Bundle another subscriptions into a separate websocket\n\tclient.compose_subscriptions([\n\t\tOrderbookSubscription([Pair(\"ETH\", \"EUR\")], \"50\", callbacks = [order_book_update]),\n\t])\n\n\t# Execute all websockets asynchronously\n\tawait client.start_subscriptions()\n\n\tawait client.close()\n\nif __name__ == \"__main__\":\n\tasyncio.run(run())\n\n```\n\nAll examples can be found in `client-example/client.py` in the GitHub repository.\n\n### Support\n\nIf 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:\n- file bugs, proposals, pull requests, ...\n- spread the word\n- donate an arbitrary tip\n * BTC: 15JUgVq3YFoPedEj5wgQgvkZRx5HQoKJC4\n * ETH: 0xf29304b6af5831030ba99aceb290a3a2129b993d\n * ADA: DdzFFzCqrhshyLV3wktXFvConETEr9mCfrMo9V3dYz4pz6yNq9PjJusfnn4kzWKQR91pWecEbKoHodPaJzgBHdV2AKeDSfR4sckrEk79\n * XRP: rhVWrjB9EGDeK4zuJ1x2KXSjjSpsDQSaU6 **+ tag** 599790141\n\n### Contact\n\nIf you feel you want to get in touch, then please\n\n- use Github Issues if it is related to the development, or\n- send an e-mail to \n\n### Affiliation\n\nIn case you are interested in an automated trading bot that will utilize `bitpanda-aio` in the near future, then feel free to visit my other project [creten](https://github.com/nardew/creten).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nardew/bitpanda-aio", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "bitpanda-aio", "package_url": "https://pypi.org/project/bitpanda-aio/", "platform": "", "project_url": "https://pypi.org/project/bitpanda-aio/", "project_urls": { "Homepage": "https://github.com/nardew/bitpanda-aio" }, "release_url": "https://pypi.org/project/bitpanda-aio/0.1.1/", "requires_dist": [ "aiohttp (==3.5.4)", "websockets (==8.0.2)", "pytz (==2019.2)" ], "requires_python": ">=3.6", "summary": "Bitpanda Global Exchange API asynchronous python client", "version": "0.1.1" }, "last_serial": 5743978, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "266bd990ae80b099e638bd6183c5af0d", "sha256": "cab0365762d05d062848abe7c87f65d20d95c968545162c030897d142525f20e" }, "downloads": -1, "filename": "bitpanda_aio-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "266bd990ae80b099e638bd6183c5af0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9140, "upload_time": "2019-08-26T21:19:57", "url": "https://files.pythonhosted.org/packages/52/99/85017e043dcc5e17118834af6e06039d2b479eb29b4a1af488da4efaed65/bitpanda_aio-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8dbfda362331f6ec1a550d17b91e3f97", "sha256": "478e0f38283098aef87ef0774ace0011caa4ff7a92d95b89367a86abf6bca059" }, "downloads": -1, "filename": "bitpanda-aio-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8dbfda362331f6ec1a550d17b91e3f97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8102, "upload_time": "2019-08-26T21:20:02", "url": "https://files.pythonhosted.org/packages/17/8d/3f22cea0c8f92a55480fa3f0d629d2b11e37a8702699ded81cd39e0d6994/bitpanda-aio-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "f91c2e76d3159696645d41e815f0d2a2", "sha256": "559c0b844b9b503609f9ca26b5f8ad530480e3fa58543cb7f930693c2aa22c81" }, "downloads": -1, "filename": "bitpanda_aio-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f91c2e76d3159696645d41e815f0d2a2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10938, "upload_time": "2019-08-27T21:39:38", "url": "https://files.pythonhosted.org/packages/38/7d/b64094cd4cf0b3327db5a79bd0d5795fa48d5878fd6a4ff7f8da71985413/bitpanda_aio-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b9278c902b8056cdcf371ca24f91ef6", "sha256": "ef93c8d076b6a005853768788f2a9fc8dd33014c523471478554700a7130abe0" }, "downloads": -1, "filename": "bitpanda-aio-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1b9278c902b8056cdcf371ca24f91ef6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8248, "upload_time": "2019-08-27T21:39:40", "url": "https://files.pythonhosted.org/packages/54/11/52c4dbcfcb2d31faccfa97ba9cdf0a8758a9a20f73773064a85acb428b01/bitpanda-aio-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3ce8d9b0e7ce37960e916260b5af92d8", "sha256": "7665a8ff40336c04fa48113f1881ab46456dc402192c2a71cd8d10a4d7b089f3" }, "downloads": -1, "filename": "bitpanda_aio-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3ce8d9b0e7ce37960e916260b5af92d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11049, "upload_time": "2019-08-28T17:10:53", "url": "https://files.pythonhosted.org/packages/66/b1/eb5edf31145d81174e50eb659050250c571e4ed260f61a9e12126a021a3c/bitpanda_aio-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2e9c26a962c8b1a445ed857860fa604", "sha256": "68aae5c3a2f1121a9a3669ee8c94e8d7c0430384c2a6d2126a3499cbba97b0c2" }, "downloads": -1, "filename": "bitpanda-aio-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b2e9c26a962c8b1a445ed857860fa604", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8517, "upload_time": "2019-08-28T17:10:55", "url": "https://files.pythonhosted.org/packages/d6/c4/52701d564e7cdc680bd2e316b1fd5d3e5d5aed0765aa4211071c1b321c70/bitpanda-aio-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3ce8d9b0e7ce37960e916260b5af92d8", "sha256": "7665a8ff40336c04fa48113f1881ab46456dc402192c2a71cd8d10a4d7b089f3" }, "downloads": -1, "filename": "bitpanda_aio-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3ce8d9b0e7ce37960e916260b5af92d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11049, "upload_time": "2019-08-28T17:10:53", "url": "https://files.pythonhosted.org/packages/66/b1/eb5edf31145d81174e50eb659050250c571e4ed260f61a9e12126a021a3c/bitpanda_aio-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2e9c26a962c8b1a445ed857860fa604", "sha256": "68aae5c3a2f1121a9a3669ee8c94e8d7c0430384c2a6d2126a3499cbba97b0c2" }, "downloads": -1, "filename": "bitpanda-aio-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b2e9c26a962c8b1a445ed857860fa604", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8517, "upload_time": "2019-08-28T17:10:55", "url": "https://files.pythonhosted.org/packages/d6/c4/52701d564e7cdc680bd2e316b1fd5d3e5d5aed0765aa4211071c1b321c70/bitpanda-aio-0.1.1.tar.gz" } ] }