tastyware/tastytrade:v12.0.0
What's Changed
For a long time this library was mostly sync, with the streamers being the exception. #168 added async endpoints on top of the existing endpoints, which gave users more flexibility. With this change, I the library moves to async-only.
There are a few reasons for this. First of all, having both sync and async versions of everything resulted in a ton of code duplication. Second, both streamers are (and always have been) async, meaning that almost all users are already implementing at least some async code, so having the separate sync versions makes less sense. Finally, this change allows us to support Trio and clean up the streamer implementation which was hard to reason about and prone to bugs.
httpx-wslibrary replaceswebsockets, allowing for Trio support. As a consequence of this, reconnect and disconnect functionality is gone (however, this is almost certainly better handled on the user side anyways).- Streamers now use
httpx-wswebsockets and structured concurrency, making them much simpler and easier to reason about (which implies a lower chance of bugs in the future). We also get to use the helpfulsend_jsonandreceive_jsonfunctions instead of wrapping everything injson.dumps/json.loads. - Python 3.10 support is dropped as we're now using
ExceptionGroups. This would likely have happened soon anyways as the official support lifecycle only goes through October 2026. - All previous sync endpoints are now async. All previous async endpoints have been removed (so instead of having endpoints named
Account.a_getfor async andAccount.getfor sync, we have a single endpoint namedAccount.get, which is async). - Session token refreshing is smarter: Instead of making users check and refresh themselves, they will auto-refresh before any request if they're close to expiry. Sessions also have an optional async context manager which can be used to ensure cleanup happens.
tastytrade.dxfeed.Quoteevents now have helpfulmid_priceandmicro_priceproperties calculated from its bid/ask prices.tastytrade.order.OrderActionhas amultiplierproperty which is-1when it's a "Sell" leg and1when it's a "Buy" leg.- Test suite now runs on both asyncio and Trio.
Full Changelog: v11.1.0...v12.0.0