ccxt-wrapper


Nameccxt-wrapper JSON
Version 0.3.3 PyPI version JSON
download
home_pagehttps://github.com/34j/ccxt-wrapper
SummaryA wrapper for CCXT with type hints, etc.
upload_time2022-12-03 04:06:06
maintainer
docs_urlNone
author34j
requires_python>=3.8,<4.0
licenseGNU General Public License v3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CCXT Wrapper

<p align="center">
  <a href="https://github.com/34j/ccxt-wrapper/actions?query=workflow%3ACI">
    <img src="https://img.shields.io/github/workflow/status/34j/ccxt-wrapper/CI/main?label=CI&logo=github&style=flat-square" alt="CI Status" >
  </a>
  <a href="https://ccxt-wrapper.readthedocs.io">
    <img src="https://img.shields.io/readthedocs/ccxt-wrapper.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
  </a>
  <a href="https://codecov.io/gh/34j/ccxt-wrapper">
    <img src="https://img.shields.io/codecov/c/github/34j/ccxt-wrapper.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
  </a>
</p>
<p align="center">
  <a href="https://python-poetry.org/">
    <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
  </a>
  <a href="https://github.com/ambv/black">
    <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
  </a>
  <a href="https://github.com/pre-commit/pre-commit">
    <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
  </a>
</p>
<p align="center">
  <a href="https://pypi.org/project/ccxt-wrapper/">
    <img src="https://img.shields.io/pypi/v/ccxt-wrapper.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
  </a>
  <img src="https://img.shields.io/pypi/pyversions/ccxt-wrapper.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
  <img src="https://img.shields.io/pypi/l/ccxt-wrapper.svg?style=flat-square" alt="License">
</p>

A wrapper around [CCXT](https://github.com/ccxt/ccxt) with type hints, etc. using [attrs](https://pypi.org/project/attrs/).

## Installation

Install this via pip (or your favourite package manager):

`pip install ccxt-wrapper`

## Usage

```Python
import warnings
from src.ccxt_wrapper.wrapper import CCXTWrapper
from ccxt.async_support import binance

with warnings.catch_warnings():
    # ccxt_wrapper will raise numerous warnings about wrong types, missing keys, etc.
    # This is 99% blame on ccxt :>
    warnings.simplefilter("ignore")

    # Creating exchange instance from CCXTWrapper
    async with CCXTWrapper.new(binance, default_type='future') as wrapper:
        # Our API
        ticker = await wrapper.fetch_ticker("BTC/USDT")
        print(type(ticker)) # attrs class <class 'src.ccxt_wrapper.dtypes.Ticker'>

        # CCXT API
        ticker_orginal = await wrapper.exchange.fetch_ticker("BTC/USDT")
        print(type(ticker_orginal)) # dict <class 'dict'>

        # Same result but more fluent
        assert ticker.high == ticker_orginal["high"]

    # Using existing exchange instance
    async with CCXTWrapper(binance()) as wrapper:
        pass
```

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center"><a href="https://github.com/34j"><img src="https://avatars.githubusercontent.com/u/55338215?v=4?s=80" width="80px;" alt="34j"/><br /><sub><b>34j</b></sub></a><br /><a href="https://github.com/34j/ccxt-wrapper/commits?author=34j" title="Code">💻</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-end -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Credits

This package was created with
[Copier](https://copier.readthedocs.io/) and the
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
project template.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/34j/ccxt-wrapper",
    "name": "ccxt-wrapper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "34j",
    "author_email": "55338215.34j@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/db/f1/a1e995fbe2b999d0c99e4bfac58f449cb22ec34a72b862a454e6a6e90a6d/ccxt_wrapper-0.3.3.tar.gz",
    "platform": null,
    "description": "# CCXT Wrapper\n\n<p align=\"center\">\n  <a href=\"https://github.com/34j/ccxt-wrapper/actions?query=workflow%3ACI\">\n    <img src=\"https://img.shields.io/github/workflow/status/34j/ccxt-wrapper/CI/main?label=CI&logo=github&style=flat-square\" alt=\"CI Status\" >\n  </a>\n  <a href=\"https://ccxt-wrapper.readthedocs.io\">\n    <img src=\"https://img.shields.io/readthedocs/ccxt-wrapper.svg?logo=read-the-docs&logoColor=fff&style=flat-square\" alt=\"Documentation Status\">\n  </a>\n  <a href=\"https://codecov.io/gh/34j/ccxt-wrapper\">\n    <img src=\"https://img.shields.io/codecov/c/github/34j/ccxt-wrapper.svg?logo=codecov&logoColor=fff&style=flat-square\" alt=\"Test coverage percentage\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://python-poetry.org/\">\n    <img src=\"https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=\" alt=\"Poetry\">\n  </a>\n  <a href=\"https://github.com/ambv/black\">\n    <img src=\"https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square\" alt=\"black\">\n  </a>\n  <a href=\"https://github.com/pre-commit/pre-commit\">\n    <img src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square\" alt=\"pre-commit\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/ccxt-wrapper/\">\n    <img src=\"https://img.shields.io/pypi/v/ccxt-wrapper.svg?logo=python&logoColor=fff&style=flat-square\" alt=\"PyPI Version\">\n  </a>\n  <img src=\"https://img.shields.io/pypi/pyversions/ccxt-wrapper.svg?style=flat-square&logo=python&amp;logoColor=fff\" alt=\"Supported Python versions\">\n  <img src=\"https://img.shields.io/pypi/l/ccxt-wrapper.svg?style=flat-square\" alt=\"License\">\n</p>\n\nA wrapper around [CCXT](https://github.com/ccxt/ccxt) with type hints, etc. using [attrs](https://pypi.org/project/attrs/).\n\n## Installation\n\nInstall this via pip (or your favourite package manager):\n\n`pip install ccxt-wrapper`\n\n## Usage\n\n```Python\nimport warnings\nfrom src.ccxt_wrapper.wrapper import CCXTWrapper\nfrom ccxt.async_support import binance\n\nwith warnings.catch_warnings():\n    # ccxt_wrapper will raise numerous warnings about wrong types, missing keys, etc.\n    # This is 99% blame on ccxt :>\n    warnings.simplefilter(\"ignore\")\n\n    # Creating exchange instance from CCXTWrapper\n    async with CCXTWrapper.new(binance, default_type='future') as wrapper:\n        # Our API\n        ticker = await wrapper.fetch_ticker(\"BTC/USDT\")\n        print(type(ticker)) # attrs class <class 'src.ccxt_wrapper.dtypes.Ticker'>\n\n        # CCXT API\n        ticker_orginal = await wrapper.exchange.fetch_ticker(\"BTC/USDT\")\n        print(type(ticker_orginal)) # dict <class 'dict'>\n\n        # Same result but more fluent\n        assert ticker.high == ticker_orginal[\"high\"]\n\n    # Using existing exchange instance\n    async with CCXTWrapper(binance()) as wrapper:\n        pass\n```\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\"><a href=\"https://github.com/34j\"><img src=\"https://avatars.githubusercontent.com/u/55338215?v=4?s=80\" width=\"80px;\" alt=\"34j\"/><br /><sub><b>34j</b></sub></a><br /><a href=\"https://github.com/34j/ccxt-wrapper/commits?author=34j\" title=\"Code\">\ud83d\udcbb</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n<!-- prettier-ignore-end -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Credits\n\nThis package was created with\n[Copier](https://copier.readthedocs.io/) and the\n[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)\nproject template.\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3",
    "summary": "A wrapper for CCXT with type hints, etc.",
    "version": "0.3.3",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "23a0e64b1bb392176fb1ba07a33d65af",
                "sha256": "d680cff49ed7faee85bb52f20d86e248fc5c5427bc1edfa58da4d8511678f71a"
            },
            "downloads": -1,
            "filename": "ccxt_wrapper-0.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "23a0e64b1bb392176fb1ba07a33d65af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 37138,
            "upload_time": "2022-12-03T04:06:04",
            "upload_time_iso_8601": "2022-12-03T04:06:04.647907Z",
            "url": "https://files.pythonhosted.org/packages/c1/a7/d334e1414172e1c65a56351acad98468bf82d99047867eb71daaca4b2226/ccxt_wrapper-0.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "37ee3967b7424ba7114a298c14d61b1f",
                "sha256": "321f3b63e10fca69afee86c3b4956fa72e751505457b7a9fe05ffd500058afa5"
            },
            "downloads": -1,
            "filename": "ccxt_wrapper-0.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "37ee3967b7424ba7114a298c14d61b1f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 37736,
            "upload_time": "2022-12-03T04:06:06",
            "upload_time_iso_8601": "2022-12-03T04:06:06.412939Z",
            "url": "https://files.pythonhosted.org/packages/db/f1/a1e995fbe2b999d0c99e4bfac58f449cb22ec34a72b862a454e6a6e90a6d/ccxt_wrapper-0.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-03 04:06:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "34j",
    "github_project": "ccxt-wrapper",
    "lcname": "ccxt-wrapper"
}
        
34j
Elapsed time: 0.02329s