{"id":13449391,"url":"https://github.com/Crypto-toolbox/bitex","last_synced_at":"2025-03-22T22:33:02.749Z","repository":{"id":57415399,"uuid":"61048235","full_name":"Crypto-toolbox/bitex","owner":"Crypto-toolbox","description":"Crypto-currency Exchange API Framework","archived":true,"fork":false,"pushed_at":"2019-11-23T07:51:46.000Z","size":3967,"stargazers_count":483,"open_issues_count":37,"forks_count":134,"subscribers_count":65,"default_branch":"master","last_synced_at":"2024-10-08T16:17:32.366Z","etag":null,"topics":["api-wrapper","crypto-currency-exchanges","crypto-exchanges","endpoint-communication","exchange","framework","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Crypto-toolbox.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-13T15:37:13.000Z","updated_at":"2024-09-26T22:40:47.000Z","dependencies_parsed_at":"2022-09-10T02:11:01.197Z","dependency_job_id":null,"html_url":"https://github.com/Crypto-toolbox/bitex","commit_stats":null,"previous_names":["nlsdfnbch/bitex"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crypto-toolbox%2Fbitex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crypto-toolbox%2Fbitex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crypto-toolbox%2Fbitex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crypto-toolbox%2Fbitex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Crypto-toolbox","download_url":"https://codeload.github.com/Crypto-toolbox/bitex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221840644,"owners_count":16889834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","crypto-currency-exchanges","crypto-exchanges","endpoint-communication","exchange","framework","python3"],"created_at":"2024-07-31T06:00:36.884Z","updated_at":"2024-10-28T14:30:55.331Z","avatar_url":"https://github.com/Crypto-toolbox.png","language":"Python","readme":"# BitEx\nBitEx is a collection of API Clients for Crypto Currency Exchanges.\n\nIt comes with two parts - `bitex.api` represents the base level API\ninterfaces, on top of which the second part - `bitex.interfaces` - builds upon.\n`bitex.api` classes can be used without making use of the interface classes.\n\nDonations welcome!\nBTC @ 3D4yuyf84eQUauyZLoQKyouPuThoxMMRZa\n# State\n--------------------------------\n\n**RESTAPI** : **Completed**\n\n**WSSAPI** : **BETA**\n\n**Interfaces** : **WIP**\n\n--------------------------------\n\n\n# Supported Exchanges\n\n| Exchange       | API  | Authentication | Public Endpoints*[^1] | Private Endpoints[^1] | Formatters | Tests |\n|----------------|------|----------------|-------------------|--------------------|------------|-------|\n| Bitfinex       | Done | Done           | Done              | Done               | WIP        | WIP   |\n| Bitstamp       | Done | Done           | Done              | Done               | WIP        | WIP   |\n| Bittrex        | Done | Done           | Done              | Done               | WIP        | WIP   |\n| Bter           | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| C-Cex          | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| CoinCheck      | Done | Done           | Done              | Done               | WIP        | WIP   |\n| Cryptopia      | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| GDAX           | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| Gemini         | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| HitBtc         | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| itBit          | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| Kraken         | Done | Done           | Done              | Done               | WIP        | WIP   |\n| OkCoin         | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| Poloniex       | Done | Done           | Done              | Done               | WIP        | WIP   |\n| Quoine         | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| QuadrigaCX     | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| TheRockTrading | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| Yunbi          | Done | BETA           | Done              | Done               | WIP        | WIP   |\n| Vaultoro       | Done | BETA           | Done              | Done               | WIP        | WIP   |\n\n\nAdditional clients will be added to (or removed from) this list, \naccording to their liquidity and market volume.\n\n[^1]: This table considers standardized methods only, when describing the state. See section `Standardized Methods` for more\n\n# bitex.api.REST\n\nClasses found in `bitex.api.REST` provide wrapper classes and methods for Python's\n`requests` module, including handling of each exchange's specific authentication\nprocedure.\n\nAn example:\n```py\nfrom bitex.api.REST import KrakenREST\n\nk = KrakenREST()\nk.load_key('kraken.key')  # loads key and secret from given file;\n\n# Query a public endpoint\nk.query('GET','public/Depth', params={'pair': 'XXBTZUSD'})\n\n# Query a private (authenticated) endpoint\nq = {'pair': 'XXBTZUSD', 'type': 'sell', 'ordertype': 'limit', 'price': 1000.0,\n     'volume': 0.01, 'validate': True}\nk.query('POST','private/AddOrder', authenticate=True, params=q)\n\n```\n\nExample `.key` file:\n```\n\u003e\u003e\u003edummy.key\nmy_api_key\nmy_fancy_api_secret\n```\n\nIf the api requires further details, for example a userid or account \nnumber (for example for bitstamp), you should check the class method's doc string,\nalthough usually this information needs to go after the api key\nand secret, on a separate line each.\n```\n\u003e\u003e\u003edummy2.key\nmy_api_key\nmy_fancy_api_secret\nUserid\naccountname\n```\n\n# bitex.api.WSS\n`bitex.api.WSS` offers `Queue()`-based Websocket interface for a select few exchanges.\nThe classes found within are very basic, and subject to further development. Private\nendpoints and trading are only sporadically implemented.\n\nTheir prime objective is to provide a raw, realtime interface to all of an exchange's\nWebsocket endpoint.\n\n## Usage\n```py\nfrom.bitex.api.WSS import GeminiWSS\nimport time\n\nwss = GeminiWSS()\nwss.start()\ntime.sleep(5)\nwss.stop()\n\nwhile not wss.data_q.empty():\n    print(wss.data_q.get())\n    \n```\nYou can of course also access `data_q` while the `WebSocket` is still running \n(i.e. before calling `stop()`).\n\n# bitex.interfaces\n\nBuilt on top of `bitex.api`'s api classes are the slightly more sophisticated\nexchange interfaces in `bitex.interfaces`. These have been written to unify\nthe diverse REST APIs of the implemented exchanges, by providing the same methods and method parameters\nacross all of them (see next section, `Standardized Methods`, for more information).\n\nFor example, querying tickers looks the same on all exchanges, as well as\nplacing an order, using `bitex.interface`:\n\n```py\nfrom bitex import Kraken, Bitstamp, Gemini\nk = Kraken(key_file='krkn.key')\nb = Bitstamp(key_file='btst.key')\ng = Gemini(key_file='gmni.key')\n\nk.ticker('XBTUSD')\nb.ticker('btceur')\ng.ticker('BTC-USD')\n\nk.ask(pair, price, size)\nb.ask(pair, price, size)\ng.ask(pair, price, size)\n```\n\n# Standardized Methods\n\nAs explained in the previous section, __standardized methods__ refer to the methods of each interface\nwhich have been deemed as part of the set of minimal methods and functions required to trade\nat an exchange via its API. They feature the following characteristics:\n\n- Each method has an identical method header across all interfaces\n- Its output is identical across all interfaces\n- Each method returns a `bitex.api.response.APIResponse` object; these behave like `requests.Request` objects, with the addition\nof a new attribute, `formatted`, which stores a standardized representation of the data queried.\n\n\n\n# bitex.formatters\n\nThis module provide formatters for the standardized methods, formatting their json output into a uniform layout. They are a work in progress feature.\n\nBe mindful that, in order to provide a unified output format, some fields have been dropped in the formatted output! If you rely on one of these dropped fields, be sure to use the `APIResponse`'s `json` attribute instead, and parse the json yourself:\n\n```py\nfrom bitex import Kraken\nk = Kraken()\nresponse = k.ticker()\nprint(response.formatted)  # show formatted data\nprint(response.json())  # Returns all json data\n```\n\nThe following is a table of all formatters currently implemented - any method not marked as `Done` will not do any formatting.\n\n| Exchange          | `ticker()` | order_book() | trades() | bid()/ask() | order() | cancel_order() | balance() | withdraw() | deposit() |\n|-------------------|------------|--------------|----------|-------------|---------|----------------|-----------|------------|-----------|\n| Bitfinex          | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Bitstamp          | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Bittrex           | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Bter              | WIP        | WIP          | WIP      | WIP         | WIP     | WIP            | WIP       | WIP        | WIP       |\n| C-Cex             | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Coincheck         | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Cryptopia         | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| GDAX              | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Gemini            | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| HitBtc            | WIP        | WIP          | WIP      | WIP         | WIP     | WIP            | WIP       | WIP        | WIP       |\n| itBit             | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Kraken            | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| OKCoin            | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Poloniex          | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| QuadrigaCX        | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Quoine            | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| TheRockTradingLTD | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n| Vaultoro          | WIP        | WIP          | WIP      | WIP         | WIP     | WIP            | WIP       | WIP        | WIP       |\n| Yunbi             | Done       | Planned      | Planned  | Planned     | Planned | Planned        | Planned   | Planned    | Planned   |\n\n\n\n# Installation\n\nManually, using the supplied `setup.py` file:\n\n`python3 setup.py install`\n\nor via pip\n\n`pip install BitEx`\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCrypto-toolbox%2Fbitex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCrypto-toolbox%2Fbitex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCrypto-toolbox%2Fbitex/lists"}