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.
- {tastytrade-12.0.0 → tastytrade-12.0.1}/PKG-INFO +1 -1
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/__init__.py +1 -1
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/streamer.py +15 -1
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/CONTRIBUTING.md +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/FUNDING.yml +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/pull_request_template.md +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/workflows/python-app.yml +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/workflows/python-publish-test.yml +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.github/workflows/python-publish.yml +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.gitignore +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.python-version +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/.readthedocs.yaml +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/LICENSE +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/Makefile +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/README.md +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/Makefile +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/account-streamer.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/accounts.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/account.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/dxfeed.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/instruments.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/market-data.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/market-sessions.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/metrics.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/order.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/search.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/session.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/streamer.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/utils.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/api/watchlists.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/conf.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/data-streamer.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/img/netliq.png +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/index.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/installation.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/instruments.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/make.bat +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/market-data.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/market-sessions.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/orders.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/sessions.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/docs/watchlists.rst +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/pyproject.toml +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/account.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/__init__.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/candle.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/event.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/greeks.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/profile.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/quote.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/summary.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/theoprice.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/timeandsale.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/trade.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/dxfeed/underlying.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/instruments.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/market_data.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/market_sessions.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/metrics.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/order.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/py.typed +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/search.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/session.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/utils.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tastytrade/watchlists.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/__init__.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/conftest.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_account.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_dxfeed.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_instruments.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_market_data.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_market_sessions.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_metrics.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_search.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_session.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_streamer.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_utils.py +0 -0
- {tastytrade-12.0.0 → tastytrade-12.0.1}/tests/test_watchlists.py +0 -0
- {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.
|
|
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
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|