Skip to content

Commit

Permalink
python 3.10 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
nardew committed Jun 23, 2022
1 parent e9c60f3 commit 4b44048
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html

## [Pending release]

## [5.3.0] - 2022-06-22

### Added

- Python `3.10` supported

## [5.2.3] - 2022-05-31

### Fixed
Expand Down Expand Up @@ -222,7 +228,8 @@ bitvavo.enums.CandelstickInterval -> bitvavo.enums.CandlestickInterval

The official release of `cryptoxlib-aio`.

[Pending release]: https://github.com/nardew/cryptoxlib-aio/compare/5.2.3...HEAD
[Pending release]: https://github.com/nardew/cryptoxlib-aio/compare/5.3.0...HEAD
[5.3.0]: https://github.com/nardew/cryptoxlib-aio/compare/5.2.3...5.3.0
[5.2.3]: https://github.com/nardew/cryptoxlib-aio/compare/5.2.2...5.2.3
[5.2.2]: https://github.com/nardew/cryptoxlib-aio/compare/5.2.1...5.2.2
[5.2.1]: https://github.com/nardew/cryptoxlib-aio/compare/5.2.0...5.2.1
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# cryptoxlib-aio 5.2.3
# cryptoxlib-aio 5.3.0

![](https://img.shields.io/badge/python-3.6-blue.svg) ![](https://img.shields.io/badge/python-3.7-blue.svg) ![](https://img.shields.io/badge/python-3.8-blue.svg) ![](https://img.shields.io/badge/python-3.9-blue.svg)
![](https://img.shields.io/badge/python-3.6-blue.svg) ![](https://img.shields.io/badge/python-3.7-blue.svg) ![](https://img.shields.io/badge/python-3.8-blue.svg) ![](https://img.shields.io/badge/python-3.9-blue.svg) ![](https://img.shields.io/badge/python-3.10-blue.svg)

`cryptoxlib-aio` is a compact Python library providing access to REST and WEBSOCKET API of selected crypto exchanges.

`cryptoxlib-aio` is designed as an asynchronous library utilizing modern features of Python and those of supporting asynchronous libraries (mainly [aiohttp](https://aiohttp.readthedocs.io/en/stable/)).

### What's been recently added

- python `3.10` supported
- `coinmate` cryptoexchange added!
- `bitpanda` cancellation of all orders via websockets
- `binance` BSwap (liquidity pools) endpoints
Expand Down
9 changes: 5 additions & 4 deletions cryptoxlib/version_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@ def is_python_version(major: int, minor: int, micro: int = None):
IS_PYTHON37 = is_python_version(3, 7)
IS_PYTHON38 = is_python_version(3, 8)
IS_PYTHON39 = is_python_version(3, 9)
IS_PYTHON310 = is_python_version(3, 10)


def async_run(f):
if IS_PYTHON36:
loop = asyncio.get_event_loop()
return loop.run_until_complete(f)
elif IS_PYTHON37 or IS_PYTHON38 or IS_PYTHON39:
elif IS_PYTHON37 or IS_PYTHON38 or IS_PYTHON39 or IS_PYTHON310:
return asyncio.run(f)

raise Exception(f'Unsupported Python version! Only versions 3.6.x, 3.7.x and 3.8.x are supported.')
raise Exception(f'Unsupported Python version! Only versions 3.6.x, 3.7.x, 3.8.x, 3.9.x and 3.10.x are supported.')


def async_create_task(f):
if IS_PYTHON36:
loop = asyncio.get_event_loop()
return loop.create_task(f)
elif IS_PYTHON37 or IS_PYTHON38 or IS_PYTHON39:
elif IS_PYTHON37 or IS_PYTHON38 or IS_PYTHON39 or IS_PYTHON310:
return asyncio.create_task(f)

raise Exception(f'Unsupported Python version! Only versions 3.6.x, 3.7.x and 3.8.x are supported.')
raise Exception(f'Unsupported Python version! Only versions 3.6.x, 3.8.x, 3.9.x and 3.10.x are supported.')


def get_current_time_ms():
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries",
Expand Down

0 comments on commit 4b44048

Please sign in to comment.