sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
6.01k stars 2.2k forks source link

feat(orjson): Add support for orjson #1286

Open hannotauber opened 1 year ago

hannotauber commented 1 year ago

At some point ujson was used for json loads https://github.com/sammchardy/python-binance/pull/383 but it does not seem to be the case any more. This code has be lost. I do in v1.0.16

[hannotauber@toolbox python-binance]$ grep -r ujson
docs/changelog.rst:- Stock json lib to ujson (https://github.com/sammchardy/python-binance/pull/383)
requirements.txt:ujson
setup.py:        'requests', 'six', 'dateparser', 'aiohttp', 'ujson', 'websockets'

I am more confident with the work and benchmark results of orjson along with the licensing which comes with Apache 2 and MIT licenses.

sammchardy commented 1 year ago

@hannotauber orjson also requires Rust and can't be installed under some interpreters.

A better option would be allowing to pass a json serializer into the Client so that any could be used.