{
"info": {
"author": "Pulkit Gupta",
"author_email": "gupta.pulkit91@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "hitbtcapi\n===================\n\nREST API Client for HitBTC\n\n|logo|\n\n.. |logo| image:: https://upload.wikimedia.org/wikipedia/en/9/9f/HitBTC_logo.png\n\nFeatures\n=========\n\n- Convenient methods for making API calls using keyword arguments\n\n - Automatic classification into form-data or query parameters\n - Automatic packing into JSON\n\n- Near 100% test coverage.\n- Tab-completable methods and attributes when using `IPython `_.\n\n\nInstallation\n=============\n\n``hitbtcapi`` is available on `PYPI `_. Install with ``pip``:\n\n.. code:: bash\n\n $ pip install hitbtcapi\n\nor with ``easy_install``:\n\n.. code:: bash\n\n $ easy_install hitbtcapi\n\nThe library is currently tested against Python versions 2.7 and 3.4+.\n\nAPI Reference\n===============\n\nThe official documentation can be found on the `HitBTC API reference page `_. You can also `explore the API `_ using Swagger UI.\n\n\nPrerequisites\n===============\n\nThe first thing you need to do is to `Sign Up with HitBTC `_.\n\nNext, you need to obtain an **API Key** and an **API Secret**. If you're writing code for your own HitBTC account, you can create API keys on `HitBTC API Settings `_ page. You can create multiple API keys with different permissions for your applications.\n\nNOTE: Make sure to enable appropriate permissions for the API key (some require email confirmation).\n\nGetting started\n=================\n\nCreate a ``Client`` object for interacting with the API:\n\n.. code:: python\n\n from hitbtcapi.client import Client\n\n api_key = 'your api key'\n api_secret = 'your api secret'\n\n client = Client(api_key,api_secret)\n\nError handling\n--------------\nAll errors occurring during interaction with the API will be raised as exceptions. These exceptions will be subclasses of ``hitbtcapi.errors.HitBTCError``. When the error involves an API request and/or response, the error will be a subclass of ``hitbtcapi.errors.APIError``, and include more information about the failed interaction. For full details of error responses, please refer to the `relevant API documentation `_.\n\n+-------------------------+----------------------+\n| Error | HTTP Status code |\n+=========================+======================+\n| InvalidRequestError | 400 |\n+-------------------------+----------------------+\n| AuthenticationError | 401 |\n+-------------------------+----------------------+\n| TwoFactorRequiredError | 402 |\n+-------------------------+----------------------+\n| InvalidScopeError | 403 |\n+-------------------------+----------------------+\n| NotFoundError | 404 |\n+-------------------------+----------------------+\n| ValidationError | 422 |\n+-------------------------+----------------------+\n| RateLimitExceededError | 429 |\n+-------------------------+----------------------+\n| InternalServerError | 500 |\n+-------------------------+----------------------+\n| ServiceUnavailableError | 503 |\n+-------------------------+----------------------+\n| GatewayTimeoutError | 504 |\n+-------------------------+----------------------+\n\nUsage\n-------\nI've done my best to make the code clean, commented, and understandable; however it may not be exhaustive. For more details, please refer to the `HitBTC API official documentation `_ or the `API Explorer `_.\n\n**IN SHORT**\n\n- **Use args for URI paths**\n- **Use kwargs for formData or query parameters**\n\n\n**Public API (Market Data)**\n\nGet available currencies, tokens, ICO etc.\n\n.. code:: python\n\n client.get_currencies()\n client.get_currency('BTC')\n\n\nGet currency symbols (currency pairs) traded on HitBTC exchange.\n\n.. code:: python\n\n client.get_symbols()\n client.get_symbol('ETHBTC')\n\n\nGet ticker information\n\n.. code:: python\n\n client.get_tickers()\n client.get_ticker('ETHBTC')\n\n\nGet trades for a specific symbol\n\n.. code:: python\n\n client.get_trades('ETHBTC')\n client.get_trades('ETHBTC',sort='ASC',limit=10)\n\n # Caution: from is a python keyword,\n # so cannot be used as a keyword argument to a function,\n # need to use dict instead\n import datetime\n today = datetime.datetime.now()\n yesterday = today - datetime.timedelta(days=1)\n params = {\n 'from': today.isoformat(),\n 'to': yesterday.isoformat()\n }\n client.get_trades('ETHBTC',sort='ASC',limit=10,**params)\n\n\nGet orderbook (electronic list of buy and sell orders) for a specific symbol, organized by price level\n\n.. code:: python\n\n client.get_orderbook('ETHBTC')\n client.get_orderbook('ETHBTC',limit=10)\n\n\nGet candles for a specific symbol (used for `OHLC `_)\n\n.. code:: python\n\n client.get_candles('ETHBTC')\n client.get_candles('ETHBTC', limit=10, period='H1')\n\n\n**Trading**\n\nGet trading balance for your account\n\n.. code:: python\n\n client.get_trading_balance()\n\n\nGet a list of active orders or a specific active order\n\n.. code:: python\n\n client.get_active_orders()\n client.get_active_orders(symbol='ETHBTC')\n\n client.get_active_order('840450210')\n client.get_active_order('840450210', wait=30000)\n\n\nCreate a new order\n\n.. code:: python\n\n client.create_order(symbol='ETHBTC',side='buy',quantity='0.063',price='0.046016') # required parameters\n client.create_order(symbol='ETHBTC',side='buy',quantity='0.063',price='0.046016', type='stopLimit', stopPrice='0.073')\n\n\nUpdate an existing order\n\n.. code:: python\n\n client.update_order('840450210',symbol='ETHBTC',side='buy',quantity='0.063',price='0.046016',timeInForce='GDC')\n\n\nCancel all open orders or a specific open order\n\n.. code:: python\n\n client.cancel_open_orders()\n client.cancel_open_orders(symbol='ETHBTC')\n\n client.cancel_order('840450210')\n\n\nGet personal trading commission rate\n\n.. code:: python\n\n client.get_trading_fee('ETHBTC')\n\n\n**Trading History**\n\nGet order history\n\n.. code:: python\n\n client.get_order_history()\n client.get_order_history(symbol='ETHBTC',limit=10)\n\n # Caution: from is a python keyword,\n # so cannot be used as a keyword argument to a function,\n # need to use dict instead\n import datetime\n today = datetime.datetime.now()\n yesterday = today - datetime.timedelta(days=1)\n params = {\n 'from': today.isoformat(),\n 'to': yesterday.isoformat()\n }\n client.get_order_history(symbol='ETHBTC',limit=10,**params)\n\nGet trade history\n\n.. code:: python\n\n client.get_trade_history()\n client.get_trade_history(symbol='ETHBTC',limit=10)\n\n # Caution: from is a python keyword,\n # so cannot be used as a keyword argument to a function,\n # need to use dict instead\n import datetime\n today = datetime.datetime.now()\n yesterday = today - datetime.timedelta(days=1)\n params = {\n 'from': today.isoformat(),\n 'to': yesterday.isoformat()\n }\n client.get_trade_history(symbol='ETHBTC',limit=10,**params)\n\n\nGet trades by order\n\n.. code:: python\n\n client.get_trades_by_orderid('840450210')\n\n**Account Information**\n\nGet account balance\n\n.. code:: python\n\n client.get_account_balance()\n\nGet deposit address for the cryptocurrency\n\n.. code:: python\n\n client.get_deposit_address('BTC')\n\nAdd deposit address for the cryptocurrency\n\n.. code:: python\n\n client.add_deposit_address('BTC')\n\nWithdraw cryptocurrency\n\n.. code:: python\n\n client.withdraw('BTC', amount='0.01', address='sOmE-cuRR-encY-addR-essH') # required parameters\n client.withdraw('BTC', amount='0.01', address='sOmE-cuRR-encY-addR-essH', networkFee='0.0003', includeFee=True, autoCommit=False)\n\n\nCommit cryptocurrency withdrawal\n\n.. code:: python\n\n client.commit_withdrawal('d2ce578f-647d-4fa0-b1aa-4a27e5ee597b')\n\nRollback cryptocurrency withdrawal\n\n.. code:: python\n\n client.rollback_withdrawal('d2ce578f-647d-4fa0-b1aa-4a27e5ee597b')\n\nTransfer money between trading and account\n\n.. code:: python\n\n client.transfer_to_trading(currency='BTC',amount='0.023',type='bankToExchange')\n\nGet all transactions or by id\n\n.. code:: python\n\n client.get_account_transactions()\n client.get_account_transactions(currency='BTC',sort='ASC',limit=10)\n\n # Caution: from is a python keyword,\n # so cannot be used as a keyword argument to a function,\n # need to use dict instead\n import datetime\n today = datetime.datetime.now()\n yesterday = today - datetime.timedelta(days=1)\n params = {\n 'from': today.isoformat(),\n 'to': yesterday.isoformat()\n }\n client.get_trade_history(currency='BTC',sort='ASC',limit=10,**params)\n\n client.get_account_transaction('d2ce578f-647d-4fa0-b1aa-4a27e5ee597b')\n\n\nTesting / Contributing\n=======================\nAny contribution is welcome! The process is simple:\n\n* Fork this repo\n* Make your changes\n* Run the tests (for multiple versions: preferred)\n* Submit a pull request.\n\n\nTesting for your current python version\n------------------------------------------\n\nTests are run via `nosetest `_. To run the tests, clone the repository and then:\n\n.. code:: bash\n\n # Install the required dependencies\n $ pip install -r requirements.txt\n $ pip install -r test-requirements.txt\n\n # Run the tests\n $ make tests\n\n\nIf you'd also like to generate an HTML coverage report (useful for figuring out which lines of code are actually being tested), make sure the requirements are installed and then run:\n\n.. code:: bash\n\n $ make coverage\n\n\nTesting for multiple python versions\n------------------------------------------\n\nI am using `tox `_ to run the test suite against multiple versions of Python. Tox requires the appropriate Python interpreters to run the tests in different environments. I would recommend using `pyenv `_ for this.\n\n\nHowever, the process is a little unintuitive because ``tox`` does not seem to work with multiple versions of python (installed via ``pyenv``) when inside a ``pyenv`` virtual environment. So, first deactivate your pyenv virtual environment:\n\n.. code:: bash\n\n $ (hitbtcapi-venv) pyenv deactivate\n\n\nand then install `tox` with pip or easy_install:\n\n.. code:: bash\n\n $ pip install tox # or\n $ easy_install tox\n\n\nInstall python versions which you want to test:\n\n.. code:: bash\n\n $ pyenv install 2.7.14\n $ pyenv install 3.5.0\n $ pyenv install 3.6.0\n\nand so forth. Now, in your project directory:\n\n.. code:: bash\n\n # all versions which are in tox.ini file\n $ pyenv local 2.7.14 3.5.0 3.6.0\n\n # run the tests for all the above versions\n $ tox\n\n\nLicense\n=========\n\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n\nAcknowledgements\n=================\n\n- `HitBTC REST API example `_",
"description_content_type": "",
"docs_url": null,
"download_url": "https://github.com/pulkit1991/hitbtcapi/tarball/1.1.1",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/pulkit1991/hitbtcapi",
"keywords": "hitbtc,api,client,bitcoin,altcoin,trading",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "hitbtcapi",
"package_url": "https://pypi.org/project/hitbtcapi/",
"platform": "",
"project_url": "https://pypi.org/project/hitbtcapi/",
"project_urls": {
"Download": "https://github.com/pulkit1991/hitbtcapi/tarball/1.1.1",
"Homepage": "https://github.com/pulkit1991/hitbtcapi"
},
"release_url": "https://pypi.org/project/hitbtcapi/1.1.1/",
"requires_dist": null,
"requires_python": "",
"summary": "HitBTC API Client library",
"version": "1.1.1"
},
"last_serial": 3750857,
"releases": {
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "99b286906f29881ad88421c91a45fa69",
"sha256": "a223b789814ee180aac9546ca60630a2ddc15c9979f4674bdaf022d945672112"
},
"downloads": -1,
"filename": "hitbtcapi-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "99b286906f29881ad88421c91a45fa69",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8179,
"upload_time": "2018-04-06T09:48:15",
"url": "https://files.pythonhosted.org/packages/c0/55/c265e69a3695ef6d13e6097ea45cd4a8b7035f1605f99f29a0a075ea98f7/hitbtcapi-1.0.1.tar.gz"
}
],
"1.1.0": [
{
"comment_text": "",
"digests": {
"md5": "86a980179c79cfd88164776cc6be958a",
"sha256": "8e1a0138be4287fad214cc80107ff68ce0ae18bad4b4ab75e05fb70000da0ae8"
},
"downloads": -1,
"filename": "hitbtcapi-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "86a980179c79cfd88164776cc6be958a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11618,
"upload_time": "2018-04-10T05:11:17",
"url": "https://files.pythonhosted.org/packages/fc/32/b6e088ace8c37c5922e5cb3b9f5cd798e07ec31f961e46758b1af91d3fc2/hitbtcapi-1.1.0.tar.gz"
}
],
"1.1.1": [
{
"comment_text": "",
"digests": {
"md5": "842eaf0c7d86d8704a22d7181c4309a5",
"sha256": "453d84858021080327170ff0256ff184926e37ca7152584c1e483747dbe1df67"
},
"downloads": -1,
"filename": "hitbtcapi-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "842eaf0c7d86d8704a22d7181c4309a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11726,
"upload_time": "2018-04-10T05:54:23",
"url": "https://files.pythonhosted.org/packages/08/b7/a5c9a53eb50faae0d1da1e34b6589ebaa011197649fd1176e18761adc67e/hitbtcapi-1.1.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "842eaf0c7d86d8704a22d7181c4309a5",
"sha256": "453d84858021080327170ff0256ff184926e37ca7152584c1e483747dbe1df67"
},
"downloads": -1,
"filename": "hitbtcapi-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "842eaf0c7d86d8704a22d7181c4309a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11726,
"upload_time": "2018-04-10T05:54:23",
"url": "https://files.pythonhosted.org/packages/08/b7/a5c9a53eb50faae0d1da1e34b6589ebaa011197649fd1176e18761adc67e/hitbtcapi-1.1.1.tar.gz"
}
]
}