wiz-trader 0.5.0__py3-none-any.whl → 0.7.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.
wiz_trader/__init__.py CHANGED
@@ -3,6 +3,6 @@
3
3
  from .quotes import QuotesClient
4
4
  from .apis import WizzerClient
5
5
 
6
- __version__ = "0.5.0"
6
+ __version__ = "0.7.0"
7
7
 
8
8
  __all__ = ["QuotesClient", "WizzerClient"]
wiz_trader/apis/client.py CHANGED
@@ -273,18 +273,61 @@ class WizzerClient:
273
273
  logger.debug("Cancelling order: %s", order_id)
274
274
  return self._make_request("DELETE", endpoint)
275
275
 
276
- def get_positions(self) -> List[Dict[str, Any]]:
276
+ def get_order(self, order_id: str) -> Dict[str, Any]:
277
277
  """
278
- Get current portfolio positions.
278
+ Get details of a specific order by ID.
279
279
 
280
+ Args:
281
+ order_id (str): ID of the order to retrieve.
282
+
280
283
  Returns:
281
- List[Dict[str, Any]]: List of positions.
284
+ Dict[str, Any]: Order details.
282
285
  """
283
- endpoint = "/portfolios/positions"
286
+ endpoint = f"/orders/{order_id}"
284
287
 
285
- logger.debug("Fetching positions")
288
+ logger.debug("Fetching order: %s", order_id)
286
289
  return self._make_request("GET", endpoint)
287
290
 
291
+ def get_positions(self, position_status: Optional[str] = None) -> List[Dict[str, Any]]:
292
+ """
293
+ Get portfolio positions with optional filtering by status.
294
+
295
+ Args:
296
+ position_status (Optional[str], optional): Filter positions by status.
297
+ Valid values: "open", "closed". If None, returns all positions.
298
+
299
+ Returns:
300
+ List[Dict[str, Any]]: List of positions matching the filter criteria.
301
+ """
302
+ endpoint = "/portfolios/positions"
303
+ params = {}
304
+
305
+ if position_status:
306
+ if position_status not in ["open", "closed"]:
307
+ raise ValueError("position_status must be either 'open', 'closed', or None")
308
+ params["positionStatus"] = position_status
309
+
310
+ logger.debug("Fetching positions with status: %s", position_status or "all")
311
+ return self._make_request("GET", endpoint, params=params)
312
+
313
+ def get_open_positions(self) -> List[Dict[str, Any]]:
314
+ """
315
+ Get all open positions in the portfolio.
316
+
317
+ Returns:
318
+ List[Dict[str, Any]]: List of open positions.
319
+ """
320
+ return self.get_positions(position_status="open")
321
+
322
+ def get_closed_positions(self) -> List[Dict[str, Any]]:
323
+ """
324
+ Get all closed positions in the portfolio.
325
+
326
+ Returns:
327
+ List[Dict[str, Any]]: List of closed positions.
328
+ """
329
+ return self.get_positions(position_status="closed")
330
+
288
331
  def get_holdings(self, portfolios: Optional[str] = "default") -> List[Dict[str, Any]]:
289
332
  """
290
333
  Get current holdings.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: wiz_trader
3
- Version: 0.5.0
3
+ Version: 0.7.0
4
4
  Summary: A Python SDK for connecting to the Wizzer.
5
5
  Home-page: https://bitbucket.org/wizzer-tech/quotes_sdk.git
6
6
  Author: Pawan Wagh
@@ -0,0 +1,9 @@
1
+ wiz_trader/__init__.py,sha256=V4DgwVGNtcnqYZhVe7pww5-IHtYqge5CQXqkaS81mfo,181
2
+ wiz_trader/apis/__init__.py,sha256=ItWKMOl4omiW0g2f-M7WRW3v-dss_ULd9vYnFyIIT9o,132
3
+ wiz_trader/apis/client.py,sha256=rq6FEA5DDCGXc4axSSzOdVvet1NWlW8L843GMp0qXQA,20562
4
+ wiz_trader/quotes/__init__.py,sha256=RF9g9CNP6bVWlmCh_ad8krm3-EWOIuVfLp0-H9fAeEM,108
5
+ wiz_trader/quotes/client.py,sha256=fUHTMGDauGF9cjsFsVAzoOwqSgD555_TLoNqmnFhLdQ,6203
6
+ wiz_trader-0.7.0.dist-info/METADATA,sha256=kqDpwsUfiECcbxhVKPUEuSedAu50L-OOPX2M4JAW12o,4281
7
+ wiz_trader-0.7.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ wiz_trader-0.7.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
9
+ wiz_trader-0.7.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,9 +0,0 @@
1
- wiz_trader/__init__.py,sha256=_X0Mp5qJUiQ5GyZsECsIXaZ-IjzF2L2Hmpxkn4zLHXI,181
2
- wiz_trader/apis/__init__.py,sha256=ItWKMOl4omiW0g2f-M7WRW3v-dss_ULd9vYnFyIIT9o,132
3
- wiz_trader/apis/client.py,sha256=EfBLHI-4cfWdrVhtKdL3rzeKheIIxGKwSFrjUE_hfWU,19131
4
- wiz_trader/quotes/__init__.py,sha256=RF9g9CNP6bVWlmCh_ad8krm3-EWOIuVfLp0-H9fAeEM,108
5
- wiz_trader/quotes/client.py,sha256=fUHTMGDauGF9cjsFsVAzoOwqSgD555_TLoNqmnFhLdQ,6203
6
- wiz_trader-0.5.0.dist-info/METADATA,sha256=35gVWkB7nVy-u1n0vrAgKJQvsaxz4hgfRdymJ4yxLjc,4281
7
- wiz_trader-0.5.0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
8
- wiz_trader-0.5.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
9
- wiz_trader-0.5.0.dist-info/RECORD,,