binance4py


Namebinance4py JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/ren3104/binance4py
SummaryPython binance API wrapper
upload_time2023-01-17 12:54:25
maintainer
docs_urlNone
authorren3104
requires_python>=3.7,<4.0
licenseMIT
keywords python binance4py api websocket cryptocurrency crypto exchange trade trading binance bitcoin btc ethereum eth
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="https://raw.githubusercontent.com/ren3104/binance4py/main/assets/binance4py_logo.png" alt="binance4py logo" width="480">
</p>

<p align="center">
  <a href="https://github.com/ren3104/binance4py/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/ren3104/binance4py"></a>
  <a href="https://pypi.org/project/binance4py"><img src="https://img.shields.io/pypi/v/binance4py?color=blue&logo=pypi&logoColor=FFE873" alt="PyPi package version"></a>
  <a href="https://pypi.org/project/binance4py"><img src="https://img.shields.io/pypi/pyversions/binance4py.svg?logo=python&logoColor=FFE873" alt="Supported python versions"></a>
  <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a>
</p>

This is an asynchronous Python wrapper for Binance exchange API.

## Features
- Implementation of all general, market, spot and websocket endpoints
- Easy to contribute and use
- Fully typed

## Installation
```bash
pip install -U binance4py
```

## Quick Start
```python
import asyncio
from binance4py import Binance


async def handle_kline(k):
    print(k)


async def main():
    client = Binance("<API_KEY>", "<API_SECRET>", testnet=True)
    async with client:
        print(await client.general.server_time())
        await client.ws.start()
        await client.ws.kline(handle_kline, "btcbusd", "1m")
        print(await client.ws.subscriptions())
        await client.ws.wait_stop()


asyncio.run(main())
```

## Using a different TLD and Cluster
This example will change all binance urls that support this from `https://api.binance.com` to `https://api2.binance.jp`
```
client = Binance(
    tld="jp",
    cluster=2
)
```

## Using a different json dumper/loader
```
import ujson


client = Binance(
    json_dumps=ujson.dumps,
    json_loads=ujson.loads
)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ren3104/binance4py",
    "name": "binance4py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "python,binance4py,api,websocket,cryptocurrency,crypto,exchange,trade,trading,binance,bitcoin,btc,ethereum,eth",
    "author": "ren3104",
    "author_email": "2ren3104@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/62/32/e511ea6e5d20cf104fa4854dd3f5a91f7bee315d29b509e2a0e4d16e86a5/binance4py-1.0.2.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/ren3104/binance4py/main/assets/binance4py_logo.png\" alt=\"binance4py logo\" width=\"480\">\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/ren3104/binance4py/blob/main/LICENSE\"><img alt=\"GitHub license\" src=\"https://img.shields.io/github/license/ren3104/binance4py\"></a>\n  <a href=\"https://pypi.org/project/binance4py\"><img src=\"https://img.shields.io/pypi/v/binance4py?color=blue&logo=pypi&logoColor=FFE873\" alt=\"PyPi package version\"></a>\n  <a href=\"https://pypi.org/project/binance4py\"><img src=\"https://img.shields.io/pypi/pyversions/binance4py.svg?logo=python&logoColor=FFE873\" alt=\"Supported python versions\"></a>\n  <a href=\"https://github.com/psf/black\"><img src=\"https://img.shields.io/badge/code%20style-black-000000.svg\" alt=\"Code style: black\"></a>\n</p>\n\nThis is an asynchronous Python wrapper for Binance exchange API.\n\n## Features\n- Implementation of all general, market, spot and websocket endpoints\n- Easy to contribute and use\n- Fully typed\n\n## Installation\n```bash\npip install -U binance4py\n```\n\n## Quick Start\n```python\nimport asyncio\nfrom binance4py import Binance\n\n\nasync def handle_kline(k):\n    print(k)\n\n\nasync def main():\n    client = Binance(\"<API_KEY>\", \"<API_SECRET>\", testnet=True)\n    async with client:\n        print(await client.general.server_time())\n        await client.ws.start()\n        await client.ws.kline(handle_kline, \"btcbusd\", \"1m\")\n        print(await client.ws.subscriptions())\n        await client.ws.wait_stop()\n\n\nasyncio.run(main())\n```\n\n## Using a different TLD and Cluster\nThis example will change all binance urls that support this from `https://api.binance.com` to `https://api2.binance.jp`\n```\nclient = Binance(\n    tld=\"jp\",\n    cluster=2\n)\n```\n\n## Using a different json dumper/loader\n```\nimport ujson\n\n\nclient = Binance(\n    json_dumps=ujson.dumps,\n    json_loads=ujson.loads\n)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python binance API wrapper",
    "version": "1.0.2",
    "split_keywords": [
        "python",
        "binance4py",
        "api",
        "websocket",
        "cryptocurrency",
        "crypto",
        "exchange",
        "trade",
        "trading",
        "binance",
        "bitcoin",
        "btc",
        "ethereum",
        "eth"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d30dc15b0cb7c32d5d0fd9333c3ba2690c8a93104588ef7b703d783c952b0c3",
                "md5": "d8ecf640ee4c4547b5076b1d3423f5e3",
                "sha256": "90b3b9a9ee6372288285356383e9fcc8db58a698d051253705e951f8035c42a7"
            },
            "downloads": -1,
            "filename": "binance4py-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d8ecf640ee4c4547b5076b1d3423f5e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 12545,
            "upload_time": "2023-01-17T12:54:23",
            "upload_time_iso_8601": "2023-01-17T12:54:23.901412Z",
            "url": "https://files.pythonhosted.org/packages/5d/30/dc15b0cb7c32d5d0fd9333c3ba2690c8a93104588ef7b703d783c952b0c3/binance4py-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6232e511ea6e5d20cf104fa4854dd3f5a91f7bee315d29b509e2a0e4d16e86a5",
                "md5": "e5998622b13a1b6b60c5e3a8ef9e34d5",
                "sha256": "7339442a4ea3ab7b034e159bfd118abc31fb8971914abee3bdc4255f3185fd13"
            },
            "downloads": -1,
            "filename": "binance4py-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e5998622b13a1b6b60c5e3a8ef9e34d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 10368,
            "upload_time": "2023-01-17T12:54:25",
            "upload_time_iso_8601": "2023-01-17T12:54:25.387326Z",
            "url": "https://files.pythonhosted.org/packages/62/32/e511ea6e5d20cf104fa4854dd3f5a91f7bee315d29b509e2a0e4d16e86a5/binance4py-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-17 12:54:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ren3104",
    "github_project": "binance4py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "binance4py"
}
        
Elapsed time: 0.02989s