tradesmart 2.0.0__py3-none-any.whl

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 (66) hide show
  1. tradesmart/__init__.py +112 -0
  2. tradesmart/__main__.py +8 -0
  3. tradesmart/_cli.py +776 -0
  4. tradesmart/_client_core.py +308 -0
  5. tradesmart/_contract_cache.py +95 -0
  6. tradesmart/_key_store.py +183 -0
  7. tradesmart/_links.py +31 -0
  8. tradesmart/_logging.py +86 -0
  9. tradesmart/_option_contracts.py +550 -0
  10. tradesmart/_session.py +70 -0
  11. tradesmart/_slicing.py +344 -0
  12. tradesmart/_ticks.py +35 -0
  13. tradesmart/_token_store.py +226 -0
  14. tradesmart/_transport/__init__.py +1 -0
  15. tradesmart/_transport/async_http.py +185 -0
  16. tradesmart/_transport/codec.py +388 -0
  17. tradesmart/_transport/outcome.py +112 -0
  18. tradesmart/_transport/ratelimit.py +194 -0
  19. tradesmart/_transport/retry.py +31 -0
  20. tradesmart/_transport/sync_http.py +368 -0
  21. tradesmart/_version.py +1 -0
  22. tradesmart/analytics.py +170 -0
  23. tradesmart/async_client.py +822 -0
  24. tradesmart/auth.py +88 -0
  25. tradesmart/client.py +794 -0
  26. tradesmart/config.py +179 -0
  27. tradesmart/endpoints/__init__.py +1 -0
  28. tradesmart/endpoints/base.py +88 -0
  29. tradesmart/endpoints/gtt.py +251 -0
  30. tradesmart/endpoints/market.py +235 -0
  31. tradesmart/endpoints/orders.py +277 -0
  32. tradesmart/endpoints/portfolio.py +46 -0
  33. tradesmart/endpoints/user.py +16 -0
  34. tradesmart/enums.py +138 -0
  35. tradesmart/errors.py +154 -0
  36. tradesmart/greeks.py +556 -0
  37. tradesmart/instruments.py +500 -0
  38. tradesmart/models/__init__.py +1 -0
  39. tradesmart/models/base.py +387 -0
  40. tradesmart/models/gtt.py +190 -0
  41. tradesmart/models/market.py +249 -0
  42. tradesmart/models/orders.py +364 -0
  43. tradesmart/models/portfolio.py +159 -0
  44. tradesmart/models/stream.py +218 -0
  45. tradesmart/models/user.py +32 -0
  46. tradesmart/py.typed +0 -0
  47. tradesmart/stream/__init__.py +9 -0
  48. tradesmart/stream/async_stream.py +809 -0
  49. tradesmart/stream/delivery.py +194 -0
  50. tradesmart/stream/protocol.py +188 -0
  51. tradesmart/stream/state.py +88 -0
  52. tradesmart/stream/sync_stream.py +630 -0
  53. tradesmart/testing/__init__.py +14 -0
  54. tradesmart/testing/_broker.py +434 -0
  55. tradesmart/testing/_replies.py +849 -0
  56. tradesmart/testing/_rest.py +559 -0
  57. tradesmart/testing/_state.py +771 -0
  58. tradesmart/testing/_ws.py +225 -0
  59. tradesmart/testing/drills.py +72 -0
  60. tradesmart/testing/pytest_plugin.py +52 -0
  61. tradesmart-2.0.0.dist-info/METADATA +166 -0
  62. tradesmart-2.0.0.dist-info/RECORD +66 -0
  63. tradesmart-2.0.0.dist-info/WHEEL +4 -0
  64. tradesmart-2.0.0.dist-info/entry_points.txt +2 -0
  65. tradesmart-2.0.0.dist-info/licenses/LICENSE +202 -0
  66. tradesmart-2.0.0.dist-info/licenses/NOTICE +7 -0
tradesmart/__init__.py ADDED
@@ -0,0 +1,112 @@
1
+ """TradeSmart API V2 client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from tradesmart._slicing import SlicedOrderResult
6
+ from tradesmart._ticks import round_to_tick
7
+ from tradesmart._version import __version__
8
+ from tradesmart.analytics import Buildup, BuildupReading, OptionChainSnapshot
9
+ from tradesmart.async_client import AsyncTradeSmart
10
+ from tradesmart.auth import AccessToken, build_authorize_url, compute_checksum
11
+ from tradesmart.client import TradeSmart
12
+ from tradesmart.config import ClientConfig
13
+ from tradesmart.enums import (
14
+ Exchange,
15
+ GttAlertType,
16
+ GttValidity,
17
+ OrderStatus,
18
+ OrderType,
19
+ Product,
20
+ TransactionType,
21
+ Validity,
22
+ )
23
+ from tradesmart.errors import (
24
+ APIError,
25
+ AuthenticationError,
26
+ ConfigurationError,
27
+ NetworkError,
28
+ NotFoundError,
29
+ OrderRejectedError,
30
+ OrderStatusUnknownError,
31
+ RateLimitError,
32
+ RequestTimeoutError,
33
+ RequestValidationError,
34
+ ResponseParseError,
35
+ ServerError,
36
+ SubscriptionLimitError,
37
+ TradeSmartError,
38
+ TransportError,
39
+ )
40
+ from tradesmart.greeks import OptionGreeks
41
+ from tradesmart.models.gtt import Gtt, TriggeredGtt
42
+ from tradesmart.models.stream import (
43
+ ConnectAck,
44
+ DepthAck,
45
+ DepthFeed,
46
+ HeartbeatAck,
47
+ OrderUpdate,
48
+ PositionAck,
49
+ PositionUpdate,
50
+ StreamMessage,
51
+ TouchlineAck,
52
+ TouchlineFeed,
53
+ UnknownMessage,
54
+ UnsubscribeAck,
55
+ )
56
+ from tradesmart.stream import AsyncTradeSmartStream, StreamState, TradeSmartStream
57
+
58
+ __all__ = [
59
+ "APIError",
60
+ "AccessToken",
61
+ "AsyncTradeSmart",
62
+ "AsyncTradeSmartStream",
63
+ "AuthenticationError",
64
+ "Buildup",
65
+ "BuildupReading",
66
+ "ClientConfig",
67
+ "ConfigurationError",
68
+ "ConnectAck",
69
+ "DepthAck",
70
+ "DepthFeed",
71
+ "Exchange",
72
+ "Gtt",
73
+ "GttAlertType",
74
+ "GttValidity",
75
+ "HeartbeatAck",
76
+ "NetworkError",
77
+ "NotFoundError",
78
+ "OptionChainSnapshot",
79
+ "OptionGreeks",
80
+ "OrderRejectedError",
81
+ "OrderStatus",
82
+ "OrderStatusUnknownError",
83
+ "OrderUpdate",
84
+ "PositionAck",
85
+ "PositionUpdate",
86
+ "OrderType",
87
+ "Product",
88
+ "RateLimitError",
89
+ "RequestTimeoutError",
90
+ "RequestValidationError",
91
+ "ResponseParseError",
92
+ "Validity",
93
+ "ServerError",
94
+ "SlicedOrderResult",
95
+ "StreamMessage",
96
+ "StreamState",
97
+ "SubscriptionLimitError",
98
+ "TouchlineAck",
99
+ "TouchlineFeed",
100
+ "TradeSmart",
101
+ "TradeSmartError",
102
+ "TradeSmartStream",
103
+ "TransactionType",
104
+ "TransportError",
105
+ "TriggeredGtt",
106
+ "UnknownMessage",
107
+ "UnsubscribeAck",
108
+ "__version__",
109
+ "build_authorize_url",
110
+ "compute_checksum",
111
+ "round_to_tick",
112
+ ]
tradesmart/__main__.py ADDED
@@ -0,0 +1,8 @@
1
+ """``python -m tradesmart``: log in and manage the saved token (see ``--help``)."""
2
+
3
+ import sys
4
+
5
+ from tradesmart._cli import main
6
+
7
+ if __name__ == "__main__":
8
+ sys.exit(main())