tastytrade 12.0.0__tar.gz → 12.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {tastytrade-12.0.0 → tastytrade-12.0.1}/PKG-INFO +1 -1
  2. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/__init__.py +1 -1
  3. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/streamer.py +15 -1
  4. {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/CONTRIBUTING.md +0 -0
  5. {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/FUNDING.yml +0 -0
  6. {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/pull_request_template.md +0 -0
  7. {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/workflows/python-app.yml +0 -0
  8. {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/workflows/python-publish-test.yml +0 -0
  9. {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/workflows/python-publish.yml +0 -0
  10. {tastytrade-12.0.0 → tastytrade-12.0.1}/.gitignore +0 -0
  11. {tastytrade-12.0.0 → tastytrade-12.0.1}/.python-version +0 -0
  12. {tastytrade-12.0.0 → tastytrade-12.0.1}/.readthedocs.yaml +0 -0
  13. {tastytrade-12.0.0 → tastytrade-12.0.1}/LICENSE +0 -0
  14. {tastytrade-12.0.0 → tastytrade-12.0.1}/Makefile +0 -0
  15. {tastytrade-12.0.0 → tastytrade-12.0.1}/README.md +0 -0
  16. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/Makefile +0 -0
  17. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/account-streamer.rst +0 -0
  18. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/accounts.rst +0 -0
  19. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/account.rst +0 -0
  20. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/dxfeed.rst +0 -0
  21. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/instruments.rst +0 -0
  22. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/market-data.rst +0 -0
  23. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/market-sessions.rst +0 -0
  24. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/metrics.rst +0 -0
  25. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/order.rst +0 -0
  26. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/search.rst +0 -0
  27. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/session.rst +0 -0
  28. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/streamer.rst +0 -0
  29. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/utils.rst +0 -0
  30. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/watchlists.rst +0 -0
  31. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/conf.py +0 -0
  32. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/data-streamer.rst +0 -0
  33. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/img/netliq.png +0 -0
  34. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/index.rst +0 -0
  35. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/installation.rst +0 -0
  36. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/instruments.rst +0 -0
  37. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/make.bat +0 -0
  38. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/market-data.rst +0 -0
  39. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/market-sessions.rst +0 -0
  40. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/orders.rst +0 -0
  41. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/sessions.rst +0 -0
  42. {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/watchlists.rst +0 -0
  43. {tastytrade-12.0.0 → tastytrade-12.0.1}/pyproject.toml +0 -0
  44. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/account.py +0 -0
  45. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/__init__.py +0 -0
  46. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/candle.py +0 -0
  47. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/event.py +0 -0
  48. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/greeks.py +0 -0
  49. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/profile.py +0 -0
  50. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/quote.py +0 -0
  51. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/summary.py +0 -0
  52. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/theoprice.py +0 -0
  53. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/timeandsale.py +0 -0
  54. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/trade.py +0 -0
  55. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/underlying.py +0 -0
  56. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/instruments.py +0 -0
  57. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/market_data.py +0 -0
  58. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/market_sessions.py +0 -0
  59. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/metrics.py +0 -0
  60. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/order.py +0 -0
  61. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/py.typed +0 -0
  62. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/search.py +0 -0
  63. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/session.py +0 -0
  64. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/utils.py +0 -0
  65. {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/watchlists.py +0 -0
  66. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/__init__.py +0 -0
  67. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/conftest.py +0 -0
  68. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_account.py +0 -0
  69. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_dxfeed.py +0 -0
  70. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_instruments.py +0 -0
  71. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_market_data.py +0 -0
  72. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_market_sessions.py +0 -0
  73. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_metrics.py +0 -0
  74. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_search.py +0 -0
  75. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_session.py +0 -0
  76. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_streamer.py +0 -0
  77. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_utils.py +0 -0
  78. {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_watchlists.py +0 -0
  79. {tastytrade-12.0.0 → tastytrade-12.0.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tastytrade
3
- Version: 12.0.0
3
+ Version: 12.0.1
4
4
  Summary: An unofficial, typed, asynchronous Python SDK for Tastytrade!
5
5
  Project-URL: Homepage, https://github.com/tastyware/tastytrade
6
6
  Project-URL: Documentation, https://tastyworks-api.rtfd.io
@@ -3,7 +3,7 @@ import logging
3
3
  API_URL = "https://api.tastyworks.com"
4
4
  API_VERSION = "20251101"
5
5
  CERT_URL = "https://api.cert.tastyworks.com"
6
- VERSION = "12.0.0"
6
+ VERSION = "12.0.1"
7
7
 
8
8
  __version__ = VERSION
9
9
  version_str: str = f"tastyware/tastytrade:v{VERSION}"
@@ -17,6 +17,7 @@ from anyio import (
17
17
  create_memory_object_stream,
18
18
  create_task_group,
19
19
  fail_after,
20
+ sleep,
20
21
  )
21
22
  from anyio import (
22
23
  Event as AnyioEvent,
@@ -378,10 +379,14 @@ class DXLinkStreamer(AsyncContextManagerMixin):
378
379
  proxy=self.session.proxy, verify=self._ssl_context
379
380
  ) as client:
380
381
  try:
381
- async with aconnect_ws(self._wss_url, client=client) as self._websocket:
382
+ # default keepalive doesn't work since TT expects a specific format
383
+ async with aconnect_ws(
384
+ self._wss_url, client=client, keepalive_ping_interval_seconds=None
385
+ ) as self._websocket:
382
386
  logger.debug("Websocket connection established.")
383
387
  async with create_task_group() as tg:
384
388
  await tg.start(self._reader)
389
+ tg.start_soon(self._heartbeat)
385
390
  yield self
386
391
  tg.cancel_scope.cancel()
387
392
  except* WebSocketDisconnect as eg:
@@ -392,6 +397,15 @@ class DXLinkStreamer(AsyncContextManagerMixin):
392
397
  ) from eg
393
398
  raise
394
399
 
400
+ async def _heartbeat(self) -> None:
401
+ # Sends a keepalive message every 30 seconds
402
+ message = {"type": "KEEPALIVE", "channel": 0}
403
+ while True:
404
+ logger.debug("sending keepalive message: %s", message)
405
+ await self._websocket.send_json(message)
406
+ # send the heartbeat every 30 seconds
407
+ await sleep(30)
408
+
395
409
  async def _reader(
396
410
  self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED
397
411
  ) -> None:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes