bitmex-websocket


Namebitmex-websocket JSON
Version 0.3.5 PyPI version JSON
download
home_pagehttps://github.com/joliveros/bitmex-websocket
SummaryBitmex websocket API
upload_time2023-04-23 00:34:54
maintainer
docs_urlNone
authorJosé Oliveros
requires_python>=3.7
licenseThe MIT License (MIT) Copyright (c) 2019 joliveros Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords bitmex websocket bot cryptocurrency
VCS
bugtrack_url
requirements alog bleach build certifi cffi charset-normalizer click cryptography docutils idna importlib-metadata jaraco.classes jeepney keyring markdown-it-py mdurl more-itertools packaging pipfreeze pkginfo pycparser pyee Pygments pyproject_hooks readme-renderer requests requests-toolbelt rfc3986 rich SecretStorage semver setuptools six twine typing_extensions urllib3 webencodings websocket-client wheel zipp
Travis-CI
coveralls test coverage No coveralls.
            bitmex-websocket
================

Install
-------

.. code-block:: sh

    $ pip install bitmex-websocket

Usage
-----

1. First you should set your `BITMEX_API_KEY` and `BITMEX_API_SECRET`. It can
   be done as follows:

.. code-block:: sh

    $ cp .env.example .env
    #  edit .env to reflect your API key and secret
    $ source .env

2. Then in your project you can consume `Instrument` as follows:

.. code-block:: python

    import websocket

    from bitmex_websocket import Instrument
    from bitmex_websocket.constants import InstrumentChannels

    websocket.enableTrace(True)


    channels = [
        InstrumentChannels.quote,
        InstrumentChannels.trade,
        InstrumentChannels.orderBookL2
    ]

    XBTUSD = Instrument(symbol='XBTUSD',
                        channels=channels)
    XBTUSD.on('action', lambda msg: print(msg))

    XBTUSD.run_forever()

TestNet
--------

You may change the `BASE_URL` by setting the `BITMEX_BASE_URL` environment variable to:
`https://testnet.bitmex.com/api/v1/`.



Examples
--------

Run example scripts:

.. code-block:: sh

    $ ./examples/example.py


Tests
-----

Testing is set up using `pytest <http://pytest.org>` and coverage is handled
with the pytest-cov plugin.

Run your tests with `pytest` in the root directory.

Coverage is ran by default and is set in the `pytest.ini` file.
To see an html output of coverage open `htmlcov/index.html` after running the tests.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/joliveros/bitmex-websocket",
    "name": "bitmex-websocket",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "bitmex,websocket,bot,cryptocurrency",
    "author": "Jos\u00e9 Oliveros",
    "author_email": "Jose Oliveros <jose.oliveros.1983@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f4/10/1eada56be1082328a82908d930f65ea147ed053b7334162b561b0dc005e8/bitmex_websocket-0.3.5.tar.gz",
    "platform": null,
    "description": "bitmex-websocket\n================\n\nInstall\n-------\n\n.. code-block:: sh\n\n    $ pip install bitmex-websocket\n\nUsage\n-----\n\n1. First you should set your `BITMEX_API_KEY` and `BITMEX_API_SECRET`. It can\n   be done as follows:\n\n.. code-block:: sh\n\n    $ cp .env.example .env\n    #  edit .env to reflect your API key and secret\n    $ source .env\n\n2. Then in your project you can consume `Instrument` as follows:\n\n.. code-block:: python\n\n    import websocket\n\n    from bitmex_websocket import Instrument\n    from bitmex_websocket.constants import InstrumentChannels\n\n    websocket.enableTrace(True)\n\n\n    channels = [\n        InstrumentChannels.quote,\n        InstrumentChannels.trade,\n        InstrumentChannels.orderBookL2\n    ]\n\n    XBTUSD = Instrument(symbol='XBTUSD',\n                        channels=channels)\n    XBTUSD.on('action', lambda msg: print(msg))\n\n    XBTUSD.run_forever()\n\nTestNet\n--------\n\nYou may change the `BASE_URL` by setting the `BITMEX_BASE_URL` environment variable to:\n`https://testnet.bitmex.com/api/v1/`.\n\n\n\nExamples\n--------\n\nRun example scripts:\n\n.. code-block:: sh\n\n    $ ./examples/example.py\n\n\nTests\n-----\n\nTesting is set up using `pytest <http://pytest.org>` and coverage is handled\nwith the pytest-cov plugin.\n\nRun your tests with `pytest` in the root directory.\n\nCoverage is ran by default and is set in the `pytest.ini` file.\nTo see an html output of coverage open `htmlcov/index.html` after running the tests.\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2019 joliveros  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Bitmex websocket API",
    "version": "0.3.5",
    "split_keywords": [
        "bitmex",
        "websocket",
        "bot",
        "cryptocurrency"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ed35ba73abbc4ff306dbaef077442fd747ac89b53e41c7242931953121f5511",
                "md5": "ccec7ef4a702c3866da2aadfe0026aab",
                "sha256": "1b873e1bea31050f1d757850140173b283e9ee2101c199d91828b7bfbdcba234"
            },
            "downloads": -1,
            "filename": "bitmex_websocket-0.3.5-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ccec7ef4a702c3866da2aadfe0026aab",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 9847,
            "upload_time": "2023-04-23T00:34:46",
            "upload_time_iso_8601": "2023-04-23T00:34:46.678869Z",
            "url": "https://files.pythonhosted.org/packages/3e/d3/5ba73abbc4ff306dbaef077442fd747ac89b53e41c7242931953121f5511/bitmex_websocket-0.3.5-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4101eada56be1082328a82908d930f65ea147ed053b7334162b561b0dc005e8",
                "md5": "c742b8cb96c6046bf815e21bf22ab41d",
                "sha256": "084087671a8cc1ced7b803beae187574c391ed3eae6fa5d37db8e0cfd5066b98"
            },
            "downloads": -1,
            "filename": "bitmex_websocket-0.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "c742b8cb96c6046bf815e21bf22ab41d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10599,
            "upload_time": "2023-04-23T00:34:54",
            "upload_time_iso_8601": "2023-04-23T00:34:54.041801Z",
            "url": "https://files.pythonhosted.org/packages/f4/10/1eada56be1082328a82908d930f65ea147ed053b7334162b561b0dc005e8/bitmex_websocket-0.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-23 00:34:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "joliveros",
    "github_project": "bitmex-websocket",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "alog",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "bleach",
            "specs": [
                [
                    "==",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "build",
            "specs": [
                [
                    "==",
                    "0.10.0"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2022.12.7"
                ]
            ]
        },
        {
            "name": "cffi",
            "specs": [
                [
                    "==",
                    "1.15.1"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.1.0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.3"
                ]
            ]
        },
        {
            "name": "cryptography",
            "specs": [
                [
                    "==",
                    "40.0.2"
                ]
            ]
        },
        {
            "name": "docutils",
            "specs": [
                [
                    "==",
                    "0.19"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.4"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "6.6.0"
                ]
            ]
        },
        {
            "name": "jaraco.classes",
            "specs": [
                [
                    "==",
                    "3.2.3"
                ]
            ]
        },
        {
            "name": "jeepney",
            "specs": [
                [
                    "==",
                    "0.8.0"
                ]
            ]
        },
        {
            "name": "keyring",
            "specs": [
                [
                    "==",
                    "23.13.1"
                ]
            ]
        },
        {
            "name": "markdown-it-py",
            "specs": [
                [
                    "==",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "mdurl",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "more-itertools",
            "specs": [
                [
                    "==",
                    "9.1.0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "23.1"
                ]
            ]
        },
        {
            "name": "pipfreeze",
            "specs": [
                [
                    "==",
                    "2.0.3"
                ]
            ]
        },
        {
            "name": "pkginfo",
            "specs": [
                [
                    "==",
                    "1.9.6"
                ]
            ]
        },
        {
            "name": "pycparser",
            "specs": [
                [
                    "==",
                    "2.21"
                ]
            ]
        },
        {
            "name": "pyee",
            "specs": [
                [
                    "==",
                    "9.0.4"
                ]
            ]
        },
        {
            "name": "Pygments",
            "specs": [
                [
                    "==",
                    "2.15.1"
                ]
            ]
        },
        {
            "name": "pyproject_hooks",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "readme-renderer",
            "specs": [
                [
                    "==",
                    "37.3"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.28.2"
                ]
            ]
        },
        {
            "name": "requests-toolbelt",
            "specs": [
                [
                    "==",
                    "0.10.1"
                ]
            ]
        },
        {
            "name": "rfc3986",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.3.4"
                ]
            ]
        },
        {
            "name": "SecretStorage",
            "specs": [
                [
                    "==",
                    "3.3.3"
                ]
            ]
        },
        {
            "name": "semver",
            "specs": [
                [
                    "==",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "setuptools",
            "specs": [
                [
                    "==",
                    "65.5.1"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    "==",
                    "4.0.2"
                ]
            ]
        },
        {
            "name": "typing_extensions",
            "specs": [
                [
                    "==",
                    "4.5.0"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.15"
                ]
            ]
        },
        {
            "name": "webencodings",
            "specs": [
                [
                    "==",
                    "0.5.1"
                ]
            ]
        },
        {
            "name": "websocket-client",
            "specs": [
                [
                    "==",
                    "1.5.1"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.40.0"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.15.0"
                ]
            ]
        }
    ],
    "lcname": "bitmex-websocket"
}
        
Elapsed time: 0.08177s