{ "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": "zaif-client\n===========\n\n|PyPI version| |License: MIT|\n\nzaif-client is a python client (sync/async) library for zaif api\n\nInstallation\n------------\n\n::\n\n $ pip install zaif-client\n\nUsage\n-----\n\nPublic\n~~~~~~\n\n.. code:: python\n\n #\n # sync\n #\n from zaif_client.public import Public\n\n client = Public(public_key='your key', private_key='your secret key')\n response = client.ticker()\n print(response.status_code, response.json())\n\n #\n # async\n #\n import grequests\n from zaif_client.publicasync import PublicAsync\n\n client = PublicAsync(public_key='your key', private_key='your secret key')\n reqs = [client.ticker(), client.depth(), ...]\n response = grequests.map(reqs)\n for r in response:\n print(r.status_code, r.json())\n\n #\n # /currencies/{currency}\n #\n client.currencies(currency='all')\n # [{\"name\": \"btc\",\"is_token\": false},{\"name\": \"XCP\",\"is_token\": true},...]\n\n #\n # /currency_pairs/{currency_pair}\n #\n client.currency_pairs(currency_pair='all')\n # [{\"name\": \"BTC/JPY\",\"title\": \"BTC/JPY\",\"currency_pair\": \"btc_jpy\",\"description\": \"\\u30d3\\u30c3\\u30c8\\u30b3\\u30a4\\u30f3\\u30fb\\u65e5\\u672c\\u5186\\u306e\\u53d6\\u5f15\\u3092\\u884c\\u3046\\u3053\\u3068\\u304c\\u3067\\u304d\\u307e\\u3059\",\"is_token\": false,\"event_number\": 0,\"item_unit_min\": 0.0001,\"item_unit_step\": 0.0001,\"aux_unit_min\": 5.0,\"aux_unit_step\": 5.0,\"seq\": 0,\"aux_japanese\": \"\\u65e5\\u672c\\u5186\",\"item_japanese\": \"\\u30d3\\u30c3\\u30c8\\u30b3\\u30a4\\u30f3\",\"aux_unit_point\": 0,},{\"name\": \"KINOKOUSAKA/JPY\",\"title\": \"KINOKOUSAKA/JPY \\u53d6\\u5f15\\u6240 - ZAIF Exchange\",\"currency_pair\": \"kinokousaka_jpy\",\"description\": \"KINOKOUSAKA/JPY \\u53d6\\u5f15\\u6240\\u3002KINOKOUSAKA\\u3068\\u65e5\\u672c\\u5186\\u306e\\u53d6\\u5f15\\u304c\\u884c\\u3048\\u307e\\u3059\\u3002\",\"is_token\": true,\"event_number\": 1,\"item_unit_min\": 0.01,\"item_unit_step\": 0.01,\"aux_unit_min\": 0.01,\"aux_unit_step\": 0.01,\"seq\": 134,\"aux_japanese\": \"\\u65e5\\u672c\\u5186\",\"item_japanese\": \"KINOKOUSAKA\",\"aux_unit_point\": 2,}...]\n\n #\n # /last_price/{currency_pair}\n #\n client.last_price(currency_pair='btc_jpy')\n # {\"last_price\": 134820.0}\n\n #\n # /ticker/{currency_pair}\n #\n client.ticker(currency_pair='btc_jpy')\n # {\"last\": 135875.0,\"high\": 136000.0,\"low\": 131570.0,\"vwap\": 133301.7489,\"volume\": 6889.215,\"bid\": 135875.0,\"ask\": 135920.0}\n\n #\n # /trades/{currency_pair}\n #\n client.trades(currency_pair='btc_jpy')\n # [{\"date\": 1491756592,\"price\": 135340.0,\"amount\": 0.02,\"tid\": 43054307,\"currency_pair\": \"btc_jpy\",\"trade_type\": \"ask\"},{\"date\": 1491756591,\"price\": 135345.0,\"amount\": 0.01,\"tid\": 43054306,\"currency_pair\": \"btc_jpy\",\"trade_type\": \"bid\"},...]\n\n #\n # /depth/{currency_pair}\n #\n client.depth(currency_pair='btc_jpy')\n # {\"asks\": [[134875.0,0.0063],[134885.0,0.1639],...],\"bids\": [[134870.0,0.01],[134865.0,0.3066],...]}\n\nTrade\n~~~~~\n\n.. code:: python\n\n #\n # sync\n #\n from zaif_client.trade import Trade\n\n client = Trade(public_key='your key', private_key='your secret key')\n response = client.get_info()\n print(response.status_code, response.json())\n\n #\n # async\n #\n import grequests\n from zaif_client.tradeasync import TradeAsync\n\n client = TradeAsync(public_key='your key', private_key='your secret key')\n reqs = [client.get_info(), client.get_info2(), ...]\n response = grequests.map(reqs)\n for r in response:\n print(r.status_code, r.json())\n\n #\n # get_info\n #\n client.get_info()\n # {\"success\":1,\"return\":{\"funds\":{\"jpy\":15320,\"btc\":1.389,\"xem\":100.2,\"mona\":2600,\"pepecash\":0.1},\"deposit\":{\"jpy\":20440,\"btc\":1.479,\"xem\":100.2,\"mona\":3200,\"pepecash\":0.1},\"rights\":{\"info\":1,\"trade\":1,\"withdraw\":0,\"personal_info\":0,\"id_info\":0,},\"trade_count\":18,\"open_orders\":3,\"server_time\":1401950833}}\n\n #\n # get_info2\n #\n client.get_info2()\n # {\"success\": 1,\"return\": {\"funds\": {\"jpy\": 15320,\"btc\": 1.389,\"xem\": 100.2,\"mona\": 2600,\"pepecash\": 0.1},\"deposit\": {\"jpy\": 20440,\"btc\": 1.479,\"xem\": 100.2,\"mona\": 3200,\"pepecash\": 0.1},\"rights\": {\"info\": 1,\"trade\": 1,\"withdraw\": 0,\"personal_info\": 0},\"open_orders\": 3,\"server_time\": 1401950833}\n\n #\n # get_personal_info\n #\n client.get_personal_info()\n # {\"success\": 1,\"return\": {\"ranking_nickname\": \"\u30cb\u30c3\u30af\u30cd\u30fc\u30e0\",\"icon_path\": \"https://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png\"}}\n\n #\n # get_id_info\n #\n client.get_id_info()\n # {'success': 1, 'return': {'user': {'certified': True, 'kana': '\u30ab\u30ca', 'id': 123123, 'name': '\u6c0f\u540d', 'email': '\u30e1\u30fc\u30eb'}}}\n\n #\n # trade_history\n #\n client.trade_history()\n # {\"success\": 1,\"return\": {\"182\": {\"currency_pair\": \"btc_jpy\",\"action\": \"bid\",\"amount\": 0.03,\"price\": 56000,\"fee\": 0,\"your_action\": \"ask\",\"bonus\": 1.6,\"timestamp\": 1402018713,\"comment\" : \"demo\"}}}\n\n #\n # active_orders\n #\n client.active_orders()\n # {\"success\": 1,\"return\": {\"184\": {\"currency_pair\": \"btc_jpy\",\"action\": \"ask\",\"amount\": 0.03,\"price\": 56000,\"timestamp\": 1402021125,\"comment\" : \"demo\"}}}is_token_both\u304ctrue\u306e\u6642\u306f\u4e0b\u8a18{\"success\": 1,\"return\": {\"active_orders\": {\"184\": {\"currency_pair\": \"btc_jpy\",\"action\": \"ask\",\"amount\": 0.03,\"price\": 56000,\"timestamp\": 1402021125,\"comment\" : \"demo\"},\"token_active_orders\": {\"235\": {\"currency_pair\": \"kaori_jpy\",\"action\": \"ask\",\"amount\": 0.3,\"price\": 10,\"timestamp\": 1402064525,\"comment\" : \"demo\"}}}}}\n\n #\n # trade\n #\n client.trade(currency_pair='btc_jpy', action='bid', price=1, amount=1)\n # {\"success\": 1,\"return\": {\"received\": 0.1,\"remains\": 0,\"order_id\": 0,\"funds\": {\"jpy\": 325,\"btc\": 1.392,\"mona\": 2600}}}\n\n #\n # cancel_order\n #\n client.cancel_order(currency_pair='btc_jpy', order_id=184)\n # {\"success\": 1,\"return\": {\"order_id\": 184,\"funds\": {\"jpy\": 15320,\"btc\": 1.392,\"mona\": 2600,\"kaori\": 0.1}}}\n\n #\n # withdraw\n #\n client.withdraw(currency='btc', address='xxxxxxx', amount=1)\n # {\"success\": 1,\"return\": {\"id\": 23634,\"fee\": 0.001,\"txid\":,\"funds\": {\"jpy\": 15320,\"btc\": 1.392,\"xem\": 100.2,\"mona\": 2600}}\n\n #\n # deposit_history\n #\n client.deposit_history(currency='jpy')\n # {\"success\":1,\"return\":{\"3816\":{\"timestamp\":1435745065,\"address\":\"12qwQ3sPJJAosodSUhSpMds4WfUPBeFEM2\",\"amount\":0.001,\"txid\":\"64dcf59523379ba282ae8cd61d2e9382c7849afe3a3802c0abb08a60067a159f\",},\"3814\":{\"timestamp\":1435548083,\"address\":\"12qwQ3sPJJAosodSUhSpMds4WfUPBeFEM2\",\"amount\":0.001,\"txid\":\"7d012cfff6e67a8938f93215367eef4177604459631ea62c85550980dca71819\"},}}\n\n #\n # withdraw_history\n #\n client.withdraw_history(currency='jpy')\n # {\"success\":1,\"return\":{\"3816\":{\"timestamp\":1435745065,\"address\":\"12qwQ3sPJJAosodSUhSpMds4WfUPBeFEM2\",\"amount\":0.001,\"txid\":\"64dcf59523379ba282ae8cd61d2e9382c7849afe3a3802c0abb08a60067a159f\",},\"3814\":{\"timestamp\":1435548083,\"address\":\"12qwQ3sPJJAosodSUhSpMds4WfUPBeFEM2\",\"amount\":0.001,\"txid\":\"7d012cfff6e67a8938f93215367eef4177604459631ea62c85550980dca71819\"},}}\n\nFutures\n~~~~~~~\n\n.. code:: python\n\n #\n # sync\n #\n from zaif_client.futures import Futures\n\n client = Futures(public_key='your key', private_key='your secret key')\n response = client.ticker()\n print(response.status_code, response.json())\n\n #\n # async\n #\n import grequests\n from zaif_client.futuresasync import FuturesAsync\n\n client = FuturesAsync(public_key='your key', private_key='your secret key')\n reqs = [client.ticker(), client.depth(), ...]\n response = grequests.map(reqs)\n for r in response:\n print(r.status_code, r.json())\n\n #\n # /groups/{group_id}\n #\n client.groups(group_id='all')\n # [{\"id\": 1,\"currency_pair\": \"btc_jpy\",\"start_timestamp\": 1480518000,\"end_timestamp\": 4102412399,\"use_swap\": false},{\"id\": 2,\"currency_pair\": \"btc_jpy\",\"start_timestamp\": 1488294000,\"end_timestamp\": 1498834800,\"use_swap\": false}]\n\n #\n # /last_price/{group_id}/{currency_pair}\n #\n client.last_price(group_id='all', currency_pair='btc_jpy')\n # [{\"last_price\": 112155.0, \"group_id\": 1},{\"last_price\": 106100.0, \"group_id\": 2},...]\n\n #\n # /ticker/{group_id}/{currency_pair}\n #\n client.ticker(group_id=1, currency_pair='btc_jpy')\n # {\"last\": 112155.0,\"high\": 117000.0,\"low\": 112155.0,\"vwap\": 115847.1429,\"volume\": 150.0007,\"bid\": 116995.0,\"ask\": 117000.0}\n\n #\n # /trades/{group_id}/{currency_pair}\n #\n client.trades(group_id=1, currency_pair='btc_jpy')\n # [{\"date\": 1491756592,\"price\": 135340.0,\"amount\": 0.02,\"tid\": 102659,\"currency_pair\": \"btc_jpy\",\"trade_type\": \"ask\"},{\"date\": 1491756591,\"price\": 135345.0,\"amount\": 0.01,\"tid\": 102658,\"currency_pair\": \"btc_jpy\",\"trade_type\": \"bid\"},...]\n\n #\n # /depth/{group_id}/{currency_pair}\n #\n client.depth(group_id=1, currency_pair='btc_jpy')\n # {\"asks\": [[134875.0,0.0063],[134885.0,0.1639],...],\"bids\": [[134870.0,0.01],[134865.0,0.3066],...]}\n\nLeverage\n~~~~~~~~\n\n.. code:: python\n\n #\n # sync\n #\n from zaif_client.leverage import Leverage\n\n client = Leverage(public_key='your key', private_key='your secret key')\n response = client.ticker()\n print(response.status_code, response.json())\n\n #\n # async\n #\n import grequests\n from zaif_client.leverageasync import LeverageAsync\n\n client = LeverageAsync(public_key='your key', private_key='your secret key')\n reqs = [client.ticker(), client.depth(), ...]\n response = grequests.map(reqs)\n for r in response:\n print(r.status_code, r.json())\n\n #\n # get_positions\n #\n client.get_positions(group_id=1, type='margin')\n # {\"success\": 1,\"return\": {\"182\": {\"group_id\": 1,\"currency_pair\": \"btc_jpy\",\"action\": \"bid\",\"leverage\": 2.5,\"price\": 110005,\"limit\": 130000,\"stop\": 90000,\"amount\": 0.03,\"fee_spent\": 0,\"timestamp\": 1402018713,\"term_end\": 1404610713,\"timestamp_closed\": 1402019000,\"deposit\": 35.76 ,\"deposit_jpy\": 35.76,\"refunded\": 35.76 ,\"refunded_jpy\": 35.76,\"swap\": 0,}}}\n\n #\n # position_history\n #\n client.position_history(group_id=1, type='margin', leverage_id=1)\n # {\"success\": 1,\"return\": {\"182\": {\"group_id\": 1,\"currency_pair\": \"btc_jpy\",\"action\": \"bid\",\"amount\": 0.0001,\"price\": 499000\"timestamp\": 1504251232\"your_action\": \"bid\",\"bid_leverage_id\": 182,},\"183\": {\"group_id\": 1,\"currency_pair\": \"btc_jpy\",\"action\": \"ask\",\"amount\": 0.0001,\"price\": 450000\"timestamp\": 1504251267\"your_action\": \"ask\",\"ask_leverage_id\": 182,},}}\n\n #\n # active_positions\n #\n client.active_positions(group_id=1, type='margin')\n # {\"success\": 1,\"return\": {\"184\": {\"group_id\": \"1\",\"currency_pair\": \"btc_jpy\",\"action\": \"ask\",\"amount\": 0.0001,\"price\": 450000,\"timestamp\": 1402021125,\"term_end\": 1404613125,\"leverage\": 1,\"fee_spent\": 0.0015,\"price_avg\": 450000,\"amount_done\": 0.0001,\"deposit_jpy\": 48.72}}}\n\n #\n # create_position\n #\n client.create_position(group_id=1, type='margin', currency_pair='btc_jpy', action='bid', price=1, amount=1, leverage=1)\n # {\"success\": 1,\"return\": {\"leverage_id\": 22258,\"timestamp\": 1504253833,\"term_end\": 1506845833,\"price_avg\": 118000,\"amount_done\": 0.0001,\"deposit_jpy\": 11.92,\"funds\": {\"jpy\": 325,\"btc\": 1.392,\"mona\": 2600}}}\n\n #\n # change_position\n #\n client.change_position(group_id=1, type='margin', leverage_id=1, price=1)\n # {\"success\": 1,\"return\": {\"leverage_id\": 22258,\"price_avg\": 118000,\"amount_done\": 0.0001,}}\n\n #\n # cancel_position\n #\n client.cancel_position(group_id=1, type='margin', leverage_id=1)\n # {'success': 1,'return': {'leverage_id': 2072,'refunded_jpy': 645.96,'funds': {'btc': 0.496,'jpy': 1564.96,'xem': 0.0,'mona': 10.0},'fee_spent': 0.0,'timestamp_closed': '1508384951','swap': 0.0}}\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/zaif-client.svg\n :target: https://badge.fury.io/py/zaif-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/zaif-api-python-client", "keywords": "zaif", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "zaif-client", "package_url": "https://pypi.org/project/zaif-client/", "platform": "", "project_url": "https://pypi.org/project/zaif-client/", "project_urls": { "Homepage": "https://github.com/10mohi6/zaif-api-python-client" }, "release_url": "https://pypi.org/project/zaif-client/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "zaif-client is a python client (sync/async) library for zaif api.", "version": "0.1.1" }, "last_serial": 5175611, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "564e63a383bdeca5ce3eea01a5be3687", "sha256": "678fa9851e9fd4c0d60b4124187b2ecb7050e95b9ef3e19cc4ad383b6b0ec74c" }, "downloads": -1, "filename": "zaif-client-0.1.0.tar.gz", "has_sig": false, "md5_digest": "564e63a383bdeca5ce3eea01a5be3687", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8545, "upload_time": "2018-05-08T11:12:27", "url": "https://files.pythonhosted.org/packages/3e/77/9c85d955a30c66d93da0175daabe01b83d06da47ea1092f8b455fa3878f0/zaif-client-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b48bb2d9903a27e1979de14a83783c39", "sha256": "22c1a23e80a9890ffc6472d29c8cffa02b2a26c4bb6adf998cbd8a7acb4142b8" }, "downloads": -1, "filename": "zaif-client-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b48bb2d9903a27e1979de14a83783c39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8787, "upload_time": "2019-04-23T05:17:04", "url": "https://files.pythonhosted.org/packages/de/54/36424c085284fb2d327aa39149f22aa6aa8d9a8c8c5db4cdab9ba5b4a762/zaif-client-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b48bb2d9903a27e1979de14a83783c39", "sha256": "22c1a23e80a9890ffc6472d29c8cffa02b2a26c4bb6adf998cbd8a7acb4142b8" }, "downloads": -1, "filename": "zaif-client-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b48bb2d9903a27e1979de14a83783c39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8787, "upload_time": "2019-04-23T05:17:04", "url": "https://files.pythonhosted.org/packages/de/54/36424c085284fb2d327aa39149f22aa6aa8d9a8c8c5db4cdab9ba5b4a762/zaif-client-0.1.1.tar.gz" } ] }