ibind 0.2.2__tar.gz → 0.2.3__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 (84) hide show
  1. {ibind-0.2.2 → ibind-0.2.3}/PKG-INFO +1 -1
  2. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_utils.py +6 -1
  3. {ibind-0.2.2 → ibind-0.2.3}/ibind.egg-info/PKG-INFO +1 -1
  4. {ibind-0.2.2 → ibind-0.2.3}/pyproject.toml +1 -1
  5. {ibind-0.2.2 → ibind-0.2.3}/test/integration/client/test_ibkr_utils_i.py +19 -3
  6. {ibind-0.2.2 → ibind-0.2.3}/LICENSE +0 -0
  7. {ibind-0.2.2 → ibind-0.2.3}/README.md +0 -0
  8. {ibind-0.2.2 → ibind-0.2.3}/ibind/__init__.py +0 -0
  9. {ibind-0.2.2 → ibind-0.2.3}/ibind/base/__init__.py +0 -0
  10. {ibind-0.2.2 → ibind-0.2.3}/ibind/base/rest_client.py +0 -0
  11. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/__init__.py +0 -0
  12. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client.py +0 -0
  13. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/__init__.py +0 -0
  14. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/accounts_mixin.py +0 -0
  15. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/contract_mixin.py +0 -0
  16. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/fa_mixin.py +0 -0
  17. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/marketdata_mixin.py +0 -0
  18. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/order_mixin.py +0 -0
  19. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/portfolio_mixin.py +0 -0
  20. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/scanner_mixin.py +0 -0
  21. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/session_mixin.py +0 -0
  22. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_client_mixins/watchlist_mixin.py +0 -0
  23. {ibind-0.2.2 → ibind-0.2.3}/ibind/client/ibkr_definitions.py +0 -0
  24. {ibind-0.2.2 → ibind-0.2.3}/ibind/events/__init__.py +0 -0
  25. {ibind-0.2.2 → ibind-0.2.3}/ibind/ibkr_ws/__init__.py +0 -0
  26. {ibind-0.2.2 → ibind-0.2.3}/ibind/ibkr_ws/ibkr_events.py +0 -0
  27. {ibind-0.2.2 → ibind-0.2.3}/ibind/ibkr_ws/ibkr_router.py +0 -0
  28. {ibind-0.2.2 → ibind-0.2.3}/ibind/ibkr_ws/ibkr_subscriptions.py +0 -0
  29. {ibind-0.2.2 → ibind-0.2.3}/ibind/ibkr_ws/ibkr_ws_client.py +0 -0
  30. {ibind-0.2.2 → ibind-0.2.3}/ibind/oauth/__init__.py +0 -0
  31. {ibind-0.2.2 → ibind-0.2.3}/ibind/oauth/oauth1a.py +0 -0
  32. {ibind-0.2.2 → ibind-0.2.3}/ibind/subscriptions/__init__.py +0 -0
  33. {ibind-0.2.2 → ibind-0.2.3}/ibind/support/__init__.py +0 -0
  34. {ibind-0.2.2 → ibind-0.2.3}/ibind/support/errors.py +0 -0
  35. {ibind-0.2.2 → ibind-0.2.3}/ibind/support/logs.py +0 -0
  36. {ibind-0.2.2 → ibind-0.2.3}/ibind/support/py_utils.py +0 -0
  37. {ibind-0.2.2 → ibind-0.2.3}/ibind/var.py +0 -0
  38. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/__init__.py +0 -0
  39. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/_ws_events.py +0 -0
  40. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/runtime/__init__.py +0 -0
  41. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/runtime/ws_emitter.py +0 -0
  42. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/runtime/ws_event_handler.py +0 -0
  43. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/runtime/ws_health_monitor.py +0 -0
  44. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/runtime/ws_lifecycle.py +0 -0
  45. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/runtime/ws_runtime_worker.py +0 -0
  46. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/runtime/ws_state_manager.py +0 -0
  47. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/ws_runtime.py +0 -0
  48. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/ws_sinks.py +0 -0
  49. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/ws_subscriptions.py +0 -0
  50. {ibind-0.2.2 → ibind-0.2.3}/ibind/ws/ws_transport.py +0 -0
  51. {ibind-0.2.2 → ibind-0.2.3}/ibind.egg-info/SOURCES.txt +0 -0
  52. {ibind-0.2.2 → ibind-0.2.3}/ibind.egg-info/dependency_links.txt +0 -0
  53. {ibind-0.2.2 → ibind-0.2.3}/ibind.egg-info/requires.txt +0 -0
  54. {ibind-0.2.2 → ibind-0.2.3}/ibind.egg-info/top_level.txt +0 -0
  55. {ibind-0.2.2 → ibind-0.2.3}/setup.cfg +0 -0
  56. {ibind-0.2.2 → ibind-0.2.3}/setup.py +0 -0
  57. {ibind-0.2.2 → ibind-0.2.3}/test/__init__.py +0 -0
  58. {ibind-0.2.2 → ibind-0.2.3}/test/conftest.py +0 -0
  59. {ibind-0.2.2 → ibind-0.2.3}/test/integration/__init__.py +0 -0
  60. {ibind-0.2.2 → ibind-0.2.3}/test/integration/base/__init__.py +0 -0
  61. {ibind-0.2.2 → ibind-0.2.3}/test/integration/base/test_rest_client_i.py +0 -0
  62. {ibind-0.2.2 → ibind-0.2.3}/test/integration/client/__init__.py +0 -0
  63. {ibind-0.2.2 → ibind-0.2.3}/test/integration/client/ibkr_responses.py +0 -0
  64. {ibind-0.2.2 → ibind-0.2.3}/test/integration/client/test_ibkr_client_i.py +0 -0
  65. {ibind-0.2.2 → ibind-0.2.3}/test/integration/ws/__init__.py +0 -0
  66. {ibind-0.2.2 → ibind-0.2.3}/test/integration/ws/test_ws_runtime_integration.py +0 -0
  67. {ibind-0.2.2 → ibind-0.2.3}/test/test_utils.py +0 -0
  68. {ibind-0.2.2 → ibind-0.2.3}/test/unit/__init__.py +0 -0
  69. {ibind-0.2.2 → ibind-0.2.3}/test/unit/client/__init__.py +0 -0
  70. {ibind-0.2.2 → ibind-0.2.3}/test/unit/client/test_ibkr_client_u.py +0 -0
  71. {ibind-0.2.2 → ibind-0.2.3}/test/unit/support/__init__.py +0 -0
  72. {ibind-0.2.2 → ibind-0.2.3}/test/unit/support/test_account_id_masking_u.py +0 -0
  73. {ibind-0.2.2 → ibind-0.2.3}/test/unit/support/test_py_utils_u.py +0 -0
  74. {ibind-0.2.2 → ibind-0.2.3}/test/unit/test_docs_u.py +0 -0
  75. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/__init__.py +0 -0
  76. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/ibkr_ws/__init__.py +0 -0
  77. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/ibkr_ws/test_ibkr_router_u.py +0 -0
  78. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/ibkr_ws/test_ibkr_subscriptions_u.py +0 -0
  79. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/ibkr_ws/test_ibkr_ws_client_u.py +0 -0
  80. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/test_ws_events_u.py +0 -0
  81. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/test_ws_runtime_u.py +0 -0
  82. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/test_ws_sinks_u.py +0 -0
  83. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/test_ws_subscriptions_u.py +0 -0
  84. {ibind-0.2.2 → ibind-0.2.3}/test/unit/ws/test_ws_transport_u.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ibind
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: IBind is a REST and WebSocket client library for Interactive Brokers Client Portal Web API.
5
5
  Author-email: Voy Zan <voy1982@yahoo.co.uk>
6
6
  Project-URL: Homepage, https://github.com/Voyz/ibind
@@ -168,12 +168,13 @@ class QuestionType(VerboseEnum):
168
168
  STOP_ORDER_RISKS = (
169
169
  'You are about to submit a stop order. Please be aware of the various stop order types available and the risks associated with each one.'
170
170
  )
171
+ LIMITED_LIQUIDITY = 'This security has limited liquidity. If you choose to trade this security, there is a heightened risk that you may not be able to close your position at the time you wish, at a price you wish, and/or without incurring a loss. Confirm that you understand the risks of trading illiquid securities.Are you sure you want to submit this order?'
171
172
  MULTIPLE_ACCOUNTS = 'This order will be distributed over multiple accounts. We strongly suggest you familiarize yourself with our allocation facilities before submitting orders.'
172
173
  DISRUPTIVE_ORDERS = 'If your order is not immediately executable, our systems may, depending on market conditions, reject your order'
173
174
  CLOSE_POSITION = 'Would you like to cancel all open orders and then place new closing order?'
174
175
  MARKET_ORDER_CONFIRMATION = 'A Market Order is an instruction to trade your order at any available price'
175
176
  STOP_VARIANT_ORDER_CONFIRMATION = (
176
- "A Stop Order - i.e. a Stop (Market) Order - is an instruction to buy or sell at the market price once your trigger (\"stop\") price is reached"
177
+ 'A Stop Order - i.e. a Stop (Market) Order - is an instruction to buy or sell at the market price once your trigger ("stop") price is reached'
177
178
  )
178
179
 
179
180
 
@@ -222,6 +223,10 @@ _MESSAGE_ID_TO_QUESTION_TYPE = {
222
223
  'o10333': (UNDEFINED, 'Option Exercise at the Money warning'),
223
224
  'o10334': (UNDEFINED, 'Warns that order will be placed into current omnibus account instead of currently selected global account.'),
224
225
  'o10335': (UNDEFINED, 'Serves internal Rapid Entry window.'),
226
+ 'o10336': (
227
+ QuestionType.LIMITED_LIQUIDITY,
228
+ 'This security has limited liquidity. If you choose to trade this security, there is a heightened risk that you may not be able to close your position at the time you wish, at a price you wish, and/or without incurring a loss. Confirm that you understand the risks of trading illiquid securities.Are you sure you want to submit this order?',
229
+ ),
225
230
  'p6': (
226
231
  QuestionType.MULTIPLE_ACCOUNTS,
227
232
  'This order will be distributed over multiple accounts. We strongly suggest you familiarize yourself with our allocation facilities before submitting orders.',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ibind
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: IBind is a REST and WebSocket client library for Interactive Brokers Client Portal Web API.
5
5
  Author-email: Voy Zan <voy1982@yahoo.co.uk>
6
6
  Project-URL: Homepage, https://github.com/Voyz/ibind
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ibind"
3
- version = "0.2.2"
3
+ version = "0.2.3"
4
4
  authors = [
5
5
  { name="Voy Zan", email="voy1982@yahoo.co.uk" },
6
6
  ]
@@ -15,7 +15,7 @@ from ibind.client.ibkr_utils import (
15
15
  parse_order_request,
16
16
  )
17
17
  from test.integration.client import ibkr_responses
18
- from test.test_utils import CaptureLogsContext
18
+ from test.test_utils import CaptureLogsContext, capture_logs
19
19
 
20
20
 
21
21
  # --------------------------------------------------------------------------------------
@@ -61,8 +61,7 @@ def test_filter_stocks(instruments, instruments_result):
61
61
 
62
62
  ## Assert
63
63
  expected_error = (
64
- f'Error getting stocks. Could not find valid instruments INVALID_SYMBOL in result: {instruments_result}. '
65
- f'Skipping query={queries[-1]}.'
64
+ f'Error getting stocks. Could not find valid instruments INVALID_SYMBOL in result: {instruments_result}. Skipping query={queries[-1]}.'
66
65
  )
67
66
  assert expected_error in cm.output
68
67
 
@@ -206,6 +205,13 @@ def test_question_type_to_message_id_successful():
206
205
  assert message_id == 'o163'
207
206
 
208
207
 
208
+ @capture_logs()
209
+ def test_limited_liquidity_message_id():
210
+ """Maps the limited-liquidity warning to its IBKR message ID."""
211
+ ## Act & Assert
212
+ assert question_type_to_message_id(QuestionType.LIMITED_LIQUIDITY) == 'o10336'
213
+
214
+
209
215
  # --------------------------------------------------------------------------------------
210
216
  # Finding answers
211
217
  # --------------------------------------------------------------------------------------
@@ -228,6 +234,16 @@ def test_valid_question(answers):
228
234
  assert answer is True
229
235
 
230
236
 
237
+ @capture_logs()
238
+ def test_limited_liquidity_question():
239
+ """Matches the limited-liquidity warning returned during order submission."""
240
+ ## Arrange
241
+ question = 'This security has limited liquidity. If you choose to trade this security, there is a heightened risk that you may not be able to close your position at the time you wish, at a price you wish, and/or without incurring a loss. Confirm that you understand the risks of trading illiquid securities.Are you sure you want to submit this order?'
242
+
243
+ ## Act & Assert
244
+ assert find_answer(question, {QuestionType.LIMITED_LIQUIDITY: True}) is True
245
+
246
+
231
247
  def test_invalid_question(answers):
232
248
  """Raises when no answer matches the provided question string."""
233
249
  ## Arrange
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