python-bitget


Namepython-bitget JSON
Version 1.0.7 PyPI version JSON
download
home_pagehttps://github.com/cuongitl/python-bitget
Summarybitget python wrapper with rest API, websocket API.
upload_time2023-08-06 09:04:41
maintainer
docs_urlNone
authorCuongitl
requires_python>=3.6
licenseMIT
keywords cuongitl bitget api restapi websocketapi example-python-bitget
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python bitget API Library


[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/cuongitl/python-bitget/-/blob/main/LICENSE)
[![python-bitget Version](https://img.shields.io/pypi/v/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)
[![python-bitget Python Versions](https://img.shields.io/pypi/pyversions/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)
[![python-bitget Downloads Per Day](https://img.shields.io/pypi/dd/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)
[![python-bitget Downloads Per Week](https://img.shields.io/pypi/dw/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)
[![python-bitget Downloads Per Month](https://img.shields.io/pypi/dm/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)
[![Downloads](https://static.pepy.tech/badge/python-bitget)](https://pypi.org/project/python-bitget/)

[bitget](https://www.bitget.com/en/referral/register?from=referral&clacCode=6EKP94LE) is a cryptocurrency derivatives exchange.

This is a wrapper around the Bitget API as described on Bitget, including all features the API provides using clear and readable objects, both for the REST  as the websocket API.

 
I am in no way affiliated with Bitget, use at your own risk.

**If you think something is broken, something is missing or have any questions, please open an [Issue](https://github.com/cuongitl/python-bitget/issues)**

# Get Started and Documentation
If you're new to Bitget, use the following link to [save 10% on all of your trade fees, and can get rewards up to $5005.](https://www.bitget.com/en/referral/register?from=referral&clacCode=6EKP94LE)
* [Register an account with Bitget.](https://partner.bitget.com/bg/e55g05831674816745836)
* [Generate an API Key and assign relevant permissions.](https://www.bitget.com/en/support/articles/360038968251-API%20Creation%20Guide)
* [Bitget API docs](https://bitgetlimited.github.io/apidoc/en/mix/#welcome)
  * [Example Bitget rest API](https://github.com/cuongitl/python-bitget/blob/master/examples/example_rest_api.py)
  * [Example Bitget websocket API](https://github.com/cuongitl/python-bitget/blob/master/examples/example_websocket_api.py)

# Install
    pip install python-bitget
# Usage

> Change your API KEY and your SECRET KEY.
### Restful Api Sample Code 

```python
from pybitget import Client

api_key = "your-api-key"
api_secret = "your-secret-key"
api_passphrase = "your-api-passphrase"

client = Client(api_key, api_secret, passphrase=api_passphrase)
result = client.mix_get_accounts(productType='UMCBL')
print(result)

```
### Websocket Sample Code 

```python
from pybitget.stream import BitgetWsClient, SubscribeReq, handel_error

from pybitget.enums import *
from pybitget import logger

api_key = "your-api-key"
api_secret = "your-secret-key"
api_passphrase = "your-api-passphrase"

def on_message(message):
    logger.info(message)


# Auth subscribe
client = BitgetWsClient(api_key=api_key,
                        api_secret=api_secret,
                        passphrase=api_passphrase,
                        verbose=True) \
    .error_listener(handel_error) \
    .build()

# multi subscribe  - Public Channels
channels = [SubscribeReq("mc", "ticker", "BTCUSD"), SubscribeReq("SP", "candle1W", "BTCUSDT")]
client.subscribe(channels, on_message)

# single subscribe -     # multi subscribe  Public Channels
channels = [SubscribeReq("mc", "ticker", "BTCUSD")]
client.subscribe(channels, on_message)

# single subscribe - Order Channel - Private Channels
channels = [SubscribeReq(WS_CHANNEL_INSTTYPE, WS_PRIVATE_ORDERS_CHANNEL, WS_CHANNEL_INSTID)]
client.subscribe(channels, on_message)
```

## Donate / Sponsor
I develop and maintain this package on my own for free in my spare time. 
Donations are greatly appreciated. If you prefer to donate any other currency please contact me.

* **BTC**:  `19rvFC79eVoCMHxJ44hB3GLhiD2HHsMJoZ`

* **BTC**:  `0xab4686635a02dff0babedddfee813d325f56cfb8`  (BEP20)

* **USDT**:  `0xab4686635a02dff0babedddfee813d325f56cfb8`  (BEP20)

* **USDT**:  `TCdyZs2mRhwYpCB5dZqiXEUoYRfiVJuq1H`  (TRC20)

* **BGB**:  `0x3ee4ca7cc911ad4e423dec2ae8f2846e9a6a0a77`  (ERC-20)

## Communities - Telegram
* Bitget: [Bitget OPENAPI](https://t.me/bitgetOpenapi)
* Author: [Cuongitl](https://t.me/Cuongitl)

## Release Notes
The release notes can be found
[here.](https://github.com/cuongitl/python-bitget/blob/master/release_notes.md)

## Contribution
* Fork this repository.
* Make pull requests with proper commit message.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cuongitl/python-bitget",
    "name": "python-bitget",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Cuongitl bitget api restapi websocketapi example-python-bitget",
    "author": "Cuongitl",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/76/54/c12d3fb88184bd40b7894de046bb623cb15fa451fa59cdd31f2d85497e1a/python-bitget-1.0.7.tar.gz",
    "platform": null,
    "description": "# Python bitget API Library\r\n\r\n\r\n[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/cuongitl/python-bitget/-/blob/main/LICENSE)\r\n[![python-bitget Version](https://img.shields.io/pypi/v/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)\r\n[![python-bitget Python Versions](https://img.shields.io/pypi/pyversions/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)\r\n[![python-bitget Downloads Per Day](https://img.shields.io/pypi/dd/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)\r\n[![python-bitget Downloads Per Week](https://img.shields.io/pypi/dw/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)\r\n[![python-bitget Downloads Per Month](https://img.shields.io/pypi/dm/python-bitget?logo=pypi)](https://pypi.org/project/python-bitget/)\r\n[![Downloads](https://static.pepy.tech/badge/python-bitget)](https://pypi.org/project/python-bitget/)\r\n\r\n[bitget](https://www.bitget.com/en/referral/register?from=referral&clacCode=6EKP94LE) is a cryptocurrency derivatives exchange.\r\n\r\nThis is a wrapper around the Bitget API as described on Bitget, including all features the API provides using clear and readable objects, both for the REST  as the websocket API.\r\n\r\n \r\nI am in no way affiliated with Bitget, use at your own risk.\r\n\r\n**If you think something is broken, something is missing or have any questions, please open an [Issue](https://github.com/cuongitl/python-bitget/issues)**\r\n\r\n# Get Started and Documentation\r\nIf you're new to Bitget, use the following link to [save 10% on all of your trade fees, and can get rewards up to $5005.](https://www.bitget.com/en/referral/register?from=referral&clacCode=6EKP94LE)\r\n* [Register an account with Bitget.](https://partner.bitget.com/bg/e55g05831674816745836)\r\n* [Generate an API Key and assign relevant permissions.](https://www.bitget.com/en/support/articles/360038968251-API%20Creation%20Guide)\r\n* [Bitget API docs](https://bitgetlimited.github.io/apidoc/en/mix/#welcome)\r\n  * [Example Bitget rest API](https://github.com/cuongitl/python-bitget/blob/master/examples/example_rest_api.py)\r\n  * [Example Bitget websocket API](https://github.com/cuongitl/python-bitget/blob/master/examples/example_websocket_api.py)\r\n\r\n# Install\r\n    pip install python-bitget\r\n# Usage\r\n\r\n> Change your API KEY and your SECRET KEY.\r\n### Restful Api Sample Code \r\n\r\n```python\r\nfrom pybitget import Client\r\n\r\napi_key = \"your-api-key\"\r\napi_secret = \"your-secret-key\"\r\napi_passphrase = \"your-api-passphrase\"\r\n\r\nclient = Client(api_key, api_secret, passphrase=api_passphrase)\r\nresult = client.mix_get_accounts(productType='UMCBL')\r\nprint(result)\r\n\r\n```\r\n### Websocket Sample Code \r\n\r\n```python\r\nfrom pybitget.stream import BitgetWsClient, SubscribeReq, handel_error\r\n\r\nfrom pybitget.enums import *\r\nfrom pybitget import logger\r\n\r\napi_key = \"your-api-key\"\r\napi_secret = \"your-secret-key\"\r\napi_passphrase = \"your-api-passphrase\"\r\n\r\ndef on_message(message):\r\n    logger.info(message)\r\n\r\n\r\n# Auth subscribe\r\nclient = BitgetWsClient(api_key=api_key,\r\n                        api_secret=api_secret,\r\n                        passphrase=api_passphrase,\r\n                        verbose=True) \\\r\n    .error_listener(handel_error) \\\r\n    .build()\r\n\r\n# multi subscribe  - Public Channels\r\nchannels = [SubscribeReq(\"mc\", \"ticker\", \"BTCUSD\"), SubscribeReq(\"SP\", \"candle1W\", \"BTCUSDT\")]\r\nclient.subscribe(channels, on_message)\r\n\r\n# single subscribe -     # multi subscribe  Public Channels\r\nchannels = [SubscribeReq(\"mc\", \"ticker\", \"BTCUSD\")]\r\nclient.subscribe(channels, on_message)\r\n\r\n# single subscribe - Order Channel - Private Channels\r\nchannels = [SubscribeReq(WS_CHANNEL_INSTTYPE, WS_PRIVATE_ORDERS_CHANNEL, WS_CHANNEL_INSTID)]\r\nclient.subscribe(channels, on_message)\r\n```\r\n\r\n## Donate / Sponsor\r\nI develop and maintain this package on my own for free in my spare time. \r\nDonations are greatly appreciated. If you prefer to donate any other currency please contact me.\r\n\r\n* **BTC**:  `19rvFC79eVoCMHxJ44hB3GLhiD2HHsMJoZ`\r\n\r\n* **BTC**:  `0xab4686635a02dff0babedddfee813d325f56cfb8`  (BEP20)\r\n\r\n* **USDT**:  `0xab4686635a02dff0babedddfee813d325f56cfb8`  (BEP20)\r\n\r\n* **USDT**:  `TCdyZs2mRhwYpCB5dZqiXEUoYRfiVJuq1H`  (TRC20)\r\n\r\n* **BGB**:  `0x3ee4ca7cc911ad4e423dec2ae8f2846e9a6a0a77`  (ERC-20)\r\n\r\n## Communities - Telegram\r\n* Bitget: [Bitget OPENAPI](https://t.me/bitgetOpenapi)\r\n* Author: [Cuongitl](https://t.me/Cuongitl)\r\n\r\n## Release Notes\r\nThe release notes can be found\r\n[here.](https://github.com/cuongitl/python-bitget/blob/master/release_notes.md)\r\n\r\n## Contribution\r\n* Fork this repository.\r\n* Make pull requests with proper commit message.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "bitget python wrapper with rest API, websocket API.",
    "version": "1.0.7",
    "project_urls": {
        "Homepage": "https://github.com/cuongitl/python-bitget"
    },
    "split_keywords": [
        "cuongitl",
        "bitget",
        "api",
        "restapi",
        "websocketapi",
        "example-python-bitget"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7654c12d3fb88184bd40b7894de046bb623cb15fa451fa59cdd31f2d85497e1a",
                "md5": "7255de7d32dfc6f120a1dccac8a91032",
                "sha256": "db2b15697cb2b396621146ed76769d55186510783577d815ff04d270b0ad5393"
            },
            "downloads": -1,
            "filename": "python-bitget-1.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "7255de7d32dfc6f120a1dccac8a91032",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 20497,
            "upload_time": "2023-08-06T09:04:41",
            "upload_time_iso_8601": "2023-08-06T09:04:41.903587Z",
            "url": "https://files.pythonhosted.org/packages/76/54/c12d3fb88184bd40b7894de046bb623cb15fa451fa59cdd31f2d85497e1a/python-bitget-1.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-06 09:04:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cuongitl",
    "github_project": "python-bitget",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "python-bitget"
}
        
Elapsed time: 0.10625s