tastytrade 11.0.0__tar.gz → 11.0.2__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 (81) hide show
  1. {tastytrade-11.0.0 → tastytrade-11.0.2}/PKG-INFO +1 -1
  2. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/orders.rst +3 -3
  3. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/__init__.py +2 -2
  4. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/metrics.py +13 -3
  5. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/utils.py +6 -2
  6. {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/CONTRIBUTING.md +0 -0
  7. {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/FUNDING.yml +0 -0
  8. {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/pull_request_template.md +0 -0
  9. {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/workflows/python-app.yml +0 -0
  10. {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/workflows/python-publish-test.yml +0 -0
  11. {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/workflows/python-publish.yml +0 -0
  12. {tastytrade-11.0.0 → tastytrade-11.0.2}/.gitignore +0 -0
  13. {tastytrade-11.0.0 → tastytrade-11.0.2}/.python-version +0 -0
  14. {tastytrade-11.0.0 → tastytrade-11.0.2}/.readthedocs.yaml +0 -0
  15. {tastytrade-11.0.0 → tastytrade-11.0.2}/LICENSE +0 -0
  16. {tastytrade-11.0.0 → tastytrade-11.0.2}/Makefile +0 -0
  17. {tastytrade-11.0.0 → tastytrade-11.0.2}/README.md +0 -0
  18. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/Makefile +0 -0
  19. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/account-streamer.rst +0 -0
  20. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/accounts.rst +0 -0
  21. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/account.rst +0 -0
  22. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/dxfeed.rst +0 -0
  23. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/instruments.rst +0 -0
  24. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/market-data.rst +0 -0
  25. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/market-sessions.rst +0 -0
  26. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/metrics.rst +0 -0
  27. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/order.rst +0 -0
  28. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/search.rst +0 -0
  29. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/session.rst +0 -0
  30. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/streamer.rst +0 -0
  31. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/utils.rst +0 -0
  32. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/watchlists.rst +0 -0
  33. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/conf.py +0 -0
  34. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/data-streamer.rst +0 -0
  35. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/img/netliq.png +0 -0
  36. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/index.rst +0 -0
  37. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/installation.rst +0 -0
  38. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/instruments.rst +0 -0
  39. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/make.bat +0 -0
  40. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/market-data.rst +0 -0
  41. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/market-sessions.rst +0 -0
  42. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/sessions.rst +0 -0
  43. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/sync-async.rst +0 -0
  44. {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/watchlists.rst +0 -0
  45. {tastytrade-11.0.0 → tastytrade-11.0.2}/pyproject.toml +0 -0
  46. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/account.py +0 -0
  47. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/__init__.py +0 -0
  48. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/candle.py +0 -0
  49. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/event.py +0 -0
  50. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/greeks.py +0 -0
  51. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/profile.py +0 -0
  52. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/quote.py +0 -0
  53. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/summary.py +0 -0
  54. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/theoprice.py +0 -0
  55. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/timeandsale.py +0 -0
  56. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/trade.py +0 -0
  57. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/underlying.py +0 -0
  58. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/instruments.py +0 -0
  59. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/market_data.py +0 -0
  60. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/market_sessions.py +0 -0
  61. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/oauth.py +0 -0
  62. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/order.py +0 -0
  63. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/py.typed +0 -0
  64. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/search.py +0 -0
  65. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/session.py +0 -0
  66. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/streamer.py +0 -0
  67. {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/watchlists.py +0 -0
  68. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/__init__.py +0 -0
  69. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/conftest.py +0 -0
  70. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_account.py +0 -0
  71. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_dxfeed.py +0 -0
  72. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_instruments.py +0 -0
  73. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_market_data.py +0 -0
  74. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_market_sessions.py +0 -0
  75. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_metrics.py +0 -0
  76. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_search.py +0 -0
  77. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_session.py +0 -0
  78. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_streamer.py +0 -0
  79. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_utils.py +0 -0
  80. {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_watchlists.py +0 -0
  81. {tastytrade-11.0.0 → tastytrade-11.0.2}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tastytrade
3
- Version: 11.0.0
3
+ Version: 11.0.2
4
4
  Summary: An unofficial, sync/async SDK for Tastytrade!
5
5
  Project-URL: Homepage, https://github.com/tastyware/tastytrade
6
6
  Project-URL: Documentation, https://tastyworks-api.rtfd.io
@@ -146,10 +146,10 @@ Notional orders are slightly different from normal orders. Since the market will
146
146
  )
147
147
  resp = account.place_order(session, order, dry_run=False)
148
148
 
149
- Cryptocurrency orders
150
- ---------------------
149
+ Cryptocurrency market orders
150
+ ----------------------------
151
151
 
152
- Cryptocurrency orders should use the special ``IOC`` TIF:
152
+ Cryptocurrency market orders should use the special ``IOC`` TIF:
153
153
 
154
154
  .. code-block:: python
155
155
 
@@ -1,10 +1,10 @@
1
1
  import logging
2
2
 
3
3
  API_URL = "https://api.tastyworks.com"
4
- API_VERSION = "20251026"
4
+ API_VERSION = "20251101"
5
5
  CERT_URL = "https://api.cert.tastyworks.com"
6
6
  VAST_URL = "https://vast.tastyworks.com"
7
- VERSION = "11.0.0"
7
+ VERSION = "11.0.2"
8
8
 
9
9
  __version__ = VERSION
10
10
  version_str: str = f"tastyware/tastytrade:v{VERSION}"
@@ -2,7 +2,7 @@ from datetime import date, datetime
2
2
  from decimal import Decimal
3
3
 
4
4
  from tastytrade.session import Session
5
- from tastytrade.utils import TastytradeData
5
+ from tastytrade.utils import TastytradeData, validate_and_parse
6
6
 
7
7
 
8
8
  class DividendInfo(TastytradeData):
@@ -206,7 +206,12 @@ async def a_get_risk_free_rate(session: Session) -> Decimal:
206
206
 
207
207
  :param session: active user session to use
208
208
  """
209
- data = await session._a_get("/margin-requirements-public-configuration")
209
+ request = session.async_client.build_request(
210
+ "GET", "/margin-requirements-public-configuration", timeout=30
211
+ )
212
+ del request.headers["Authorization"]
213
+ response = await session.async_client.send(request)
214
+ data = validate_and_parse(response)
210
215
  return Decimal(data["risk-free-rate"])
211
216
 
212
217
 
@@ -216,5 +221,10 @@ def get_risk_free_rate(session: Session) -> Decimal:
216
221
 
217
222
  :param session: active user session to use
218
223
  """
219
- data = session._get("/margin-requirements-public-configuration")
224
+ request = session.sync_client.build_request(
225
+ "GET", "/margin-requirements-public-configuration", timeout=30
226
+ )
227
+ del request.headers["Authorization"]
228
+ response = session.sync_client.send(request)
229
+ data = validate_and_parse(response)
220
230
  return Decimal(data["risk-free-rate"])
@@ -344,9 +344,11 @@ def paginate(
344
344
  json = response.json()
345
345
  res.extend([model(**i) for i in json["data"]["items"]])
346
346
  # handle pagination
347
+ pagination = json.get("pagination")
347
348
  if (
348
- json["pagination"]["page-offset"] >= json["pagination"]["total-pages"] - 1
349
+ not pagination
349
350
  or not paginate
351
+ or pagination["page-offset"] >= pagination["total-pages"] - 1
350
352
  ):
351
353
  break
352
354
  params["page-offset"] += 1
@@ -382,9 +384,11 @@ async def a_paginate(
382
384
  json = response.json()
383
385
  res.extend([model(**i) for i in json["data"]["items"]])
384
386
  # handle pagination
387
+ pagination = json.get("pagination")
385
388
  if (
386
- json["pagination"]["page-offset"] >= json["pagination"]["total-pages"] - 1
389
+ not pagination
387
390
  or not paginate
391
+ or pagination["page-offset"] >= pagination["total-pages"] - 1
388
392
  ):
389
393
  break
390
394
  params["page-offset"] += 1
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