{ "info": { "author": "10mohi6", "author_email": "10.mohi.6.y@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "bitflyer-client\n===============\n\n|PyPI version| |License: MIT|\n\nbitflyer-client is a python client (sync/async) library for bitflyer api\n\nInstallation\n------------\n\n::\n\n $ pip install bitflyer-client\n\nUsage\n-----\n\n.. code:: python\n\n #\n # sync\n #\n from bitflyer_client.sync import Client\n\n client = Client(public_key='your api key', private_key='your api secret')\n response = client.markets()\n print(response.status_code, response.json())\n\n #\n # async\n #\n import grequests\n from bitflyer_client.async import Async\n\n client = Async(public_key='your api key', private_key='your api secret')\n reqs = [client.markets(), client.board(), client.ticker(), ...]\n response = grequests.map(reqs)\n for r in response:\n print(r.status_code, r.json())\n\n #\n # /v1/markets\n #\n client.markets()\n # [{ \"product_code\": \"BTC_JPY\" },{ \"product_code\": \"FX_BTC_JPY\" },{ \"product_code\": \"ETH_BTC\" },{\"product_code\": \"BTCJPY28APR2017\",\"alias\": \"BTCJPY_MAT1WK\"},{\"product_code\": \"BTCJPY05MAY2017\",\"alias\": \"BTCJPY_MAT2WK\"}]\n\n #\n # /v1/board\n #\n client.board()\n # {\"mid_price\": 33320,\"bids\": [{\"price\": 30000,\"size\": 0.1},{\"price\": 25570,\"size\": 3}],\"asks\": [{\"price\": 36640,\"size\": 5},{\"price\": 36700,\"size\": 1.2}]}\n\n #\n # /v1/ticker\n #\n client.ticker()\n # {\"mid_price\": 33320,\"bids\": [{\"price\": 30000,\"size\": 0.1},{\"price\": 25570,\"size\": 3}],\"asks\": [{\"price\": 36640,\"size\": 5},{\"price\": 36700,\"size\": 1.2}]}\n\n #\n # /v1/executions\n #\n client.executions()\n # [{\"id\": 39287,\"side\": \"BUY\",\"price\": 31690,\"size\": 27.04,\"exec_date\": \"2015-07-08T02:43:34.823\",\"buy_child_order_acceptance_id\": \"JRF20150707-200203-452209\",\"sell_child_order_acceptance_id\": \"JRF20150708-024334-060234\"},{\"id\": 39286,\"side\": \"SELL\",\"price\": 33170,\"size\": 0.36,\"exec_date\": \"2015-07-08T02:43:34.72\",\"buy_child_order_acceptance_id\": \"JRF20150708-010230-400876\",\"sell_child_order_acceptance_id\": \"JRF20150708-024334-197755\"}]\n\n #\n # /v1/getboardstate\n #\n client.getboardstate()\n # {\"health\": \"NORMAL\",\"state\": \"RUNNING\",}{\"health\": \"NORMAL\",\"state\": \"MATURED\",\"data\": {\"special_quotation\": 410897}}\n\n #\n # /v1/gethealth\n #\n client.gethealth()\n # {\"status\": \"NORMAL\"}\n\n #\n # /v1/getchats\n #\n client.getchats()\n # [{\"nickname\": \"User1234567\",\"message\": \"Hello world!\",\"date\": \"2016-02-16T10:58:08.833\"},{\"nickname\": \"\u30d3\u30c3\u30c8\u592a\u90ce\",\"message\": \"\u30b5\u30f3\u30d7\u30eb\u30e1\u30c3\u30bb\u30fc\u30b8\",\"date\": \"2016-02-15T10:18:06.67\"}]\n\n #\n # /v1/me/getpermissions\n #\n client.getpermissions()\n # [\"/v1/me/getpermissions\",\"/v1/me/getbalance\",\"/v1/me/getcollateral\",\"/v1/me/getchildorders\",\"/v1/me/getparentorders\",\"/v1/me/getparentorder\",\"/v1/me/getexecutions\",\"/v1/me/getpositions\"]\n\n #\n # /v1/me/getbalance\n #\n client.getbalance()\n # [{\"currency_code\": \"JPY\",\"amount\": 1024078,\"available\": 508000},{\"currency_code\": \"BTC\",\"amount\": 10.24,\"available\": 4.12},{\"currency_code\": \"ETH\",\"amount\": 20.48,\"available\": 16.38}]\n\n #\n # /v1/me/getcollateral\n #\n client.getcollateral()\n # {\"collateral\": 100000,\"open_position_pnl\": -715,\"require_collateral\": 19857,\"keep_rate\": 5.000}\n\n #\n # /v1/me/getcollateralaccounts\n #\n client.getcollateralaccounts()\n # [{\"currency_code\": \"JPY\",\"amount\": 10000},{\"currency_code\": \"BTC\",\"amount\": 1.23}]\n\n #\n # /v1/me/getaddresses\n #\n client.getaddresses()\n # [{\"type\": \"NORMAL\",\"currency_code\": \"BTC\",\"address\": \"3AYrDq8zhF82NJ2ZaLwBMPmaNziaKPaxa7\"},{\"type\": \"NORMAL\",\"currency_code\": \"ETH\",\"address\": \"0x7fbB2CC24a3C0cd3789a44e9073381Ca6470853f\"}]\n\n #\n # /v1/me/getcoinins\n #\n client.getcoinins()\n # [{\"id\": 100,\"order_id\": \"CDP20151227-024141-055555\",\"currency_code\": \"BTC\",\"amount\": 0.00002,\"address\": \"1WriteySQufKZ2pVuM1oMhPrTtTVFq35j\",\"tx_hash\": \"9f92ee65a176bb9545f7becb8706c50d07d4cee5ffca34d8be3ef11d411405ae\",\"status\": \"COMPLETED\",\"event_date\": \"2015-11-27T08:59:20.301\"}]\n\n #\n # /v1/me/getcoinouts\n #\n client.getcoinouts()\n # [{\"id\": 500,\"order_id\": \"CWD20151224-014040-077777\",\"currency_code\": \"BTC\",\"amount\": 0.1234,\"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\"tx_hash\": \"724c07dfd4044abcb390b0412c3e707dd5c4f373f0a52b3bd295ce32b478c60a\",\"fee\": 0.0005,\"additional_fee\": 0.0001,\"status\": \"COMPLETED\",\"event_date\": \"2015-12-24T01:40:40.397\"}]\n\n #\n # /v1/me/getbankaccounts\n #\n client.getbankaccounts()\n # [{\"id\": 3402,\"is_verified\": true,\"bank_name\": \"\u4e09\u4e95\u4f4f\u53cb\u9280\u884c\",\"branch_name\": \"\u30a2\u30aa\u30a4\u652f\u5e97\",\"account_type\": \"\u666e\u901a\",\"account_number\": \"1111111\",\"account_name\": \"\u30d3\u30c3\u30c8\u30d5\u30e9\u30a4\u30e4\u30fc\u30bf\u30ed\u30a6\"}]\n\n #\n # /v1/me/getdeposits\n #\n client.getdeposits()\n # [{\"id\": 300,\"order_id\": \"MDP20151014-101010-033333\",\"currency_code\": \"JPY\",\"amount\": 10000,\"status\": \"COMPLETED\",\"event_date\": \"2015-10-14T10:10:10.001\"}]\n\n #\n # /v1/me/withdraw\n #\n client.withdraw(bank_account_id=1234, amount=12000, code=012345)\n # {\"message_id\": \"69476620-5056-4003-bcbe-42658a2b041b\"}\n\n #\n # /v1/me/getwithdrawals\n #\n client.getwithdrawals()\n # [{\"id\": 700,\"order_id\": \"MWD20151020-090909-011111\",\"currency_code\": \"JPY\",\"amount\": 12000,\"status\": \"COMPLETED\",\"event_date\": \"2015-10-20T09:09:09.416\"}]\n\n #\n # /v1/me/sendchildorder\n #\n client.sendchildorder(price=30000, size=0.1)\n # 200 OK\n\n #\n # /v1/me/cancelchildorder\n #\n client.cancelchildorder(child_order_id='JOR20150707-055555-022222')\n # 200 OK\n\n #\n # /v1/me/sendparentorder\n #\n client.sendparentorder()\n # 200 OK\n\n #\n # /v1/me/cancelparentorder\n #\n client.cancelparentorder()\n # 200 OK\n\n #\n # /v1/me/cancelallchildorders\n #\n client.cancelallchildorders()\n # 200 OK\n\n #\n # /v1/me/getchildorders\n #\n data = client.getchildorders()\n print(data)\n # [{\"id\": 138398,\"child_order_id\": \"JOR20150707-084555-022523\",\"product_code\": \"BTC_JPY\",\"side\": \"BUY\",\"child_order_type\": \"LIMIT\",\"price\": 30000,\"average_price\": 30000,\"size\": 0.1,\"child_order_state\": \"COMPLETED\",\"expire_date\": \"2015-07-14T07:25:52\",\"child_order_date\": \"2015-07-07T08:45:53\",\"child_order_acceptance_id\": \"JRF20150707-084552-031927\",\"outstanding_size\": 0,\"cancel_size\": 0,\"executed_size\": 0.1,\"total_commission\": 0},{\"id\": 138397,\"child_order_id\": \"JOR20150707-084549-022519\",\"product_code\": \"BTC_JPY\",\"side\": \"SELL\",\"child_order_type\": \"LIMIT\",\"price\": 30000,\"average_price\": 0,\"size\": 0.1,\"child_order_state\": \"CANCELED\",\"expire_date\": \"2015-07-14T07:25:47\",\"child_order_date\": \"2015-07-07T08:45:47\",\"child_order_acceptance_id\": \"JRF20150707-084547-396699\",\"outstanding_size\": 0,\"cancel_size\": 0.1,\"executed_size\": 0,\"total_commission\": 0}]\n\n #\n # /v1/me/getparentorders\n #\n client.getparentorders()\n # [{\"id\": 138398,\"parent_order_id\": \"JCO20150707-084555-022523\",\"product_code\": \"BTC_JPY\",\"side\": \"BUY\",\"parent_order_type\": \"STOP\",\"price\": 30000,\"average_price\": 30000,\"size\": 0.1,\"parent_order_state\": \"COMPLETED\",\"expire_date\": \"2015-07-14T07:25:52\",\"parent_order_date\": \"2015-07-07T08:45:53\",\"parent_order_acceptance_id\": \"JRF20150707-084552-031927\",\"outstanding_size\": 0,\"cancel_size\": 0,\"executed_size\": 0.1,\"total_commission\": 0},{\"id\": 138397,\"parent_order_id\": \"JCO20150707-084549-022519\",\"product_code\": \"BTC_JPY\",\"side\": \"SELL\",\"parent_order_type\": \"IFD\",\"price\": 30000,\"average_price\": 0,\"size\": 0.1,\"parent_order_state\": \"CANCELED\",\"expire_date\": \"2015-07-14T07:25:47\",\"parent_order_date\": \"2015-07-07T08:45:47\",\"parent_order_acceptance_id\": \"JRF20150707-084547-396699\",\"outstanding_size\": 0,\"cancel_size\": 0.1,\"executed_size\": 0,\"total_commission\": 0}]\n\n #\n # /v1/me/getparentorder\n #\n client.getparentorder(parent_order_id=4242)\n # {\"id\": 4242,\"parent_order_id\": \"JCO20150925-046876-036161\",\"order_method\": \"IFDOCO\",\"minute_to_expire\": 10000,\"parameters\": [{\"product_code\": \"BTC_JPY\",\"condition_type\": \"LIMIT\",\"side\": \"BUY\",\"price\": 30000,\"size\": 0.1,\"trigger_price\": 0,\"offset\": 0}, {\"product_code\": \"BTC_JPY\",\"condition_type\": \"LIMIT\",\"side\": \"SELL\",\"price\": 32000,\"size\": 0.1,\"trigger_price\": 0,\"offset\": 0}, {\"product_code\": \"BTC_JPY\",\"condition_type\": \"STOP_LIMIT\",\"side\": \"SELL\",\"price\": 28800,\"size\": 0.1,\"trigger_price\": 29000,\"offset\": 0}],\"parent_order_acceptance_id\": \"JRF20150925-060559-396699\"}\n\n #\n # /v1/me/getexecutions\n #\n client.getexecutions()\n # [{\"id\": 37233,\"child_order_id\": \"JOR20150707-060559-021935\",\"side\": \"BUY\",\"price\": 33470,\"size\": 0.01,\"commission\": 0,\"exec_date\": \"2015-07-07T09:57:40.397\",\"child_order_acceptance_id\": \"JRF20150707-060559-396699\"},{\"id\": 37232,\"child_order_id\": \"JOR20150707-060426-021925\",\"side\": \"BUY\",\"price\": 33470,\"size\": 0.01,\"commission\": 0,\"exec_date\": \"2015-07-07T09:57:40.397\",\"child_order_acceptance_id\": \"JRF20150707-060559-396699\"}]\n\n #\n # /v1/me/getpositions\n #\n client.getpositions()\n # [{\"product_code\": \"FX_BTC_JPY\",\"side\": \"BUY\",\"price\": 36000,\"size\": 10,\"commission\": 0,\"swap_point_accumulate\": -35,\"require_collateral\": 120000,\"open_date\": \"2015-11-03T10:04:45.011\",\"leverage\": 3,\"pnl\": 965,\"sfd\": -0.5}]\n\n #\n # /v1/me/getcollateralhistory\n #\n client.getcollateralhistory()\n # [{\"id\": 4995,\"currency_code\": \"JPY\",\"change\": -6,\"amount\": -6,\"reason_code\": \"CLEARING_COLL\",\"date\": \"2017-05-18T02:37:41.327\"},{\"id\": 4994,\"currency_code\": \"JPY\",\"change\": 2083698,\"amount\": 0,\"reason_code\": \"EXCHANGE_COLL\",\"date\": \"2017-04-28T03:05:07.493\"},{\"id\": 4993,\"currency_code\": \"BTC\",\"change\": -14.69001618,\"amount\": 34.97163164,\"reason_code\": \"EXCHANGE_COLL\",\"date\": \"2017-04-28T03:05:07.493\"}]\n\n #\n # /v1/me/gettradingcommission\n #\n client.gettradingcommission(product_code='BTC_JPY')\n # {\"commission_rate\": 0.001}\n\nContributing\n------------\n\n1. Fork it\n2. Create your feature branch (``git checkout -b my-new-feature``)\n3. Commit your changes (``git commit -am 'Add some feature'``)\n4. Push to the branch (``git push origin my-new-feature``)\n5. Create new Pull Request\n\n.. |PyPI version| image:: https://badge.fury.io/py/bitflyer-client.svg\n :target: https://badge.fury.io/py/bitflyer-client\n.. |License: MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg\n :target: https://opensource.org/licenses/MIT", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/10mohi6/bitflyer-api-python-client", "keywords": "bitflyer", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bitflyer-client", "package_url": "https://pypi.org/project/bitflyer-client/", "platform": "", "project_url": "https://pypi.org/project/bitflyer-client/", "project_urls": { "Homepage": "https://github.com/10mohi6/bitflyer-api-python-client" }, "release_url": "https://pypi.org/project/bitflyer-client/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "bitflyer-client is a python client (sync/async) library for bitflyer api.", "version": "0.1.1" }, "last_serial": 5174011, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5ecea3aa3b5568dacc0550279ecb5334", "sha256": "7756923ec3e718b749bae4817cc50880ae92132e1eb350e3e79795f398e2fd17" }, "downloads": -1, "filename": "bitflyer-client-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5ecea3aa3b5568dacc0550279ecb5334", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5755, "upload_time": "2018-05-06T14:39:50", "url": "https://files.pythonhosted.org/packages/cb/44/f6c7ea39c62c30276326197b9fa4e079e5da18ded6ecdabfb1fc14747b2e/bitflyer-client-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f25c95a11a578b19f3684ae40291ceeb", "sha256": "3407b8cb7a52338fde50bfb322b68a608a8e6ffa4425bf0342fe185686ba9f59" }, "downloads": -1, "filename": "bitflyer-client-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f25c95a11a578b19f3684ae40291ceeb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6648, "upload_time": "2019-04-22T18:36:39", "url": "https://files.pythonhosted.org/packages/39/22/4086e7ae9da9542f3937eab22ba4281d39ebab08dc7c3bb42e9862e4d8b7/bitflyer-client-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f25c95a11a578b19f3684ae40291ceeb", "sha256": "3407b8cb7a52338fde50bfb322b68a608a8e6ffa4425bf0342fe185686ba9f59" }, "downloads": -1, "filename": "bitflyer-client-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f25c95a11a578b19f3684ae40291ceeb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6648, "upload_time": "2019-04-22T18:36:39", "url": "https://files.pythonhosted.org/packages/39/22/4086e7ae9da9542f3937eab22ba4281d39ebab08dc7c3bb42e9862e4d8b7/bitflyer-client-0.1.1.tar.gz" } ] }