wiz-trader 0.9.0__py3-none-any.whl → 0.11.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 +1 -1
- wiz_trader/apis/client.py +176 -44
- wiz_trader/quotes/client.py +231 -222
- wiz_trader-0.11.0.dist-info/METADATA +1722 -0
- wiz_trader-0.11.0.dist-info/RECORD +9 -0
- {wiz_trader-0.9.0.dist-info → wiz_trader-0.11.0.dist-info}/WHEEL +1 -1
- wiz_trader-0.9.0.dist-info/METADATA +0 -165
- wiz_trader-0.9.0.dist-info/RECORD +0 -9
- {wiz_trader-0.9.0.dist-info → wiz_trader-0.11.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
wiz_trader/__init__.py,sha256=C0FSsZWVvQ5bLn9WzjVb3QD4erLfxjy5V0bCAjxBECE,182
|
2
|
+
wiz_trader/apis/__init__.py,sha256=ItWKMOl4omiW0g2f-M7WRW3v-dss_ULd9vYnFyIIT9o,132
|
3
|
+
wiz_trader/apis/client.py,sha256=4Vu9z0cLjJ62LTNT13UwicU0Ez3jnwQOcirWtJAF4Hw,25578
|
4
|
+
wiz_trader/quotes/__init__.py,sha256=RF9g9CNP6bVWlmCh_ad8krm3-EWOIuVfLp0-H9fAeEM,108
|
5
|
+
wiz_trader/quotes/client.py,sha256=LJeMcQPjJIRxrTIGalWsLYh_XfinDXBP5-4cNS7qCxc,9709
|
6
|
+
wiz_trader-0.11.0.dist-info/METADATA,sha256=IpTpq7bUvtWlCM1f-BVOx9K2MTM_HCsLXd_T5aefXKU,53081
|
7
|
+
wiz_trader-0.11.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
8
|
+
wiz_trader-0.11.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
|
9
|
+
wiz_trader-0.11.0.dist-info/RECORD,,
|
@@ -1,165 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: wiz_trader
|
3
|
-
Version: 0.9.0
|
4
|
-
Summary: A Python SDK for connecting to the Wizzer.
|
5
|
-
Home-page: https://bitbucket.org/wizzer-tech/quotes_sdk.git
|
6
|
-
Author: Pawan Wagh
|
7
|
-
Author-email: Pawan Wagh <pawan@wizzer.in>
|
8
|
-
License: MIT
|
9
|
-
Project-URL: Homepage, https://bitbucket.org/wizzer-tech/quotes_sdk.git
|
10
|
-
Project-URL: Bug Tracker, https://bitbucket.org/wizzer-tech/quotes_sdk/issues
|
11
|
-
Keywords: finance,trading,sdk
|
12
|
-
Classifier: Development Status :: 3 - Alpha
|
13
|
-
Classifier: Intended Audience :: Financial and Insurance Industry
|
14
|
-
Classifier: Intended Audience :: Developers
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
16
|
-
Classifier: Operating System :: OS Independent
|
17
|
-
Classifier: License :: OSI Approved :: MIT License
|
18
|
-
Classifier: Topic :: Office/Business :: Financial
|
19
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
20
|
-
Requires-Python: >=3.6
|
21
|
-
Description-Content-Type: text/markdown
|
22
|
-
Requires-Dist: websockets
|
23
|
-
Requires-Dist: requests
|
24
|
-
Dynamic: author
|
25
|
-
Dynamic: home-page
|
26
|
-
Dynamic: requires-python
|
27
|
-
|
28
|
-
# WizTrader SDK
|
29
|
-
|
30
|
-
A Python SDK for connecting to the Wizzer trading platform.
|
31
|
-
|
32
|
-
## Installation
|
33
|
-
|
34
|
-
You can install the package directly from PyPI:
|
35
|
-
|
36
|
-
```bash
|
37
|
-
pip install wiz_trader
|
38
|
-
```
|
39
|
-
|
40
|
-
## Features
|
41
|
-
|
42
|
-
- Real-time market data through WebSocket connection
|
43
|
-
- REST API for accessing market data and indices
|
44
|
-
- Automatic WebSocket reconnection with exponential backoff
|
45
|
-
- Subscribe/unsubscribe to instruments
|
46
|
-
- Customizable logging levels
|
47
|
-
|
48
|
-
## Quick Start - Quotes Client
|
49
|
-
|
50
|
-
```python
|
51
|
-
import asyncio
|
52
|
-
from wiz_trader import QuotesClient
|
53
|
-
|
54
|
-
# Callback function to process market data
|
55
|
-
def process_tick(data):
|
56
|
-
print(f"Received tick: {data}")
|
57
|
-
|
58
|
-
async def main():
|
59
|
-
# Initialize client with direct parameters
|
60
|
-
client = QuotesClient(
|
61
|
-
base_url="wss://websocket-url/quotes",
|
62
|
-
token="your-jwt-token",
|
63
|
-
log_level="info" # Options: "error", "info", "debug"
|
64
|
-
)
|
65
|
-
|
66
|
-
# Set callback
|
67
|
-
client.on_tick = process_tick
|
68
|
-
|
69
|
-
# Connect in the background
|
70
|
-
connection_task = asyncio.create_task(client.connect())
|
71
|
-
|
72
|
-
# Subscribe to instruments
|
73
|
-
await client.subscribe(["NSE:SBIN:3045"])
|
74
|
-
|
75
|
-
# Keep the connection running
|
76
|
-
try:
|
77
|
-
await asyncio.sleep(3600) # Run for 1 hour
|
78
|
-
except KeyboardInterrupt:
|
79
|
-
# Unsubscribe and close
|
80
|
-
await client.unsubscribe(["NSE:SBIN:3045"])
|
81
|
-
await client.close()
|
82
|
-
|
83
|
-
await connection_task
|
84
|
-
|
85
|
-
if __name__ == "__main__":
|
86
|
-
asyncio.run(main())
|
87
|
-
```
|
88
|
-
|
89
|
-
## Quick Start - DataHub Client
|
90
|
-
|
91
|
-
```python
|
92
|
-
from wiz_trader import WizzerClient
|
93
|
-
|
94
|
-
# Initialize client
|
95
|
-
client = WizzerClient(
|
96
|
-
base_url="https://api-url.in",
|
97
|
-
token="your-jwt-token",
|
98
|
-
log_level="info" # Options: "error", "info", "debug"
|
99
|
-
)
|
100
|
-
|
101
|
-
# Get list of indices
|
102
|
-
indices = client.get_indices(exchange="NSE")
|
103
|
-
print(indices)
|
104
|
-
|
105
|
-
# Get index components
|
106
|
-
components = client.get_index_components(
|
107
|
-
trading_symbol="NIFTY 50",
|
108
|
-
exchange="NSE"
|
109
|
-
)
|
110
|
-
print(components)
|
111
|
-
|
112
|
-
# Get historical OHLCV data
|
113
|
-
historical_data = client.get_historical_ohlcv(
|
114
|
-
instruments=["NSE:SBIN:3045"],
|
115
|
-
start_date="2024-01-01",
|
116
|
-
end_date="2024-01-31",
|
117
|
-
ohlcv=["open", "high", "low", "close", "volume"]
|
118
|
-
)
|
119
|
-
print(historical_data)
|
120
|
-
```
|
121
|
-
|
122
|
-
## Configuration
|
123
|
-
|
124
|
-
You can configure the clients in two ways:
|
125
|
-
|
126
|
-
1. **Direct parameter passing** (recommended):
|
127
|
-
```python
|
128
|
-
quotes_client = QuotesClient(
|
129
|
-
base_url="wss://websocket-url/quotes",
|
130
|
-
token="your-jwt-token",
|
131
|
-
log_level="info"
|
132
|
-
)
|
133
|
-
|
134
|
-
wizzer_client = WizzerClient(
|
135
|
-
base_url="https://api-url.in",
|
136
|
-
token="your-jwt-token",
|
137
|
-
log_level="info"
|
138
|
-
)
|
139
|
-
```
|
140
|
-
|
141
|
-
2. **System environment variables**:
|
142
|
-
- `WZ__QUOTES_BASE_URL`: WebSocket URL for the quotes server
|
143
|
-
- `WZ__API_BASE_URL`: Base URL for the Wizzer's REST API
|
144
|
-
- `WZ__TOKEN`: JWT token for authentication
|
145
|
-
|
146
|
-
```python
|
147
|
-
# The clients will automatically use the environment variables if parameters are not provided
|
148
|
-
quotes_client = QuotesClient(log_level="info")
|
149
|
-
wizzer_client = WizzerClient(log_level="info")
|
150
|
-
```
|
151
|
-
|
152
|
-
## Advanced Usage
|
153
|
-
|
154
|
-
Check the `examples/` directory for more detailed examples:
|
155
|
-
|
156
|
-
- `example_manual.py`: Demonstrates direct configuration with parameters
|
157
|
-
- `example_wizzer.py`: Demonstrates usage of the Wizzer client
|
158
|
-
|
159
|
-
## License
|
160
|
-
|
161
|
-
This project is licensed under the MIT License - see the LICENSE file for details.
|
162
|
-
|
163
|
-
## Contributing
|
164
|
-
|
165
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
@@ -1,9 +0,0 @@
|
|
1
|
-
wiz_trader/__init__.py,sha256=IOxpQuLhYFFBe75RCqoa81faDkt84n1pMIuiTND5_Kc,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=gYiX65AjzCEHIwCROjcu7d6uGirpGj4bnkNQ2UOQEv8,9790
|
6
|
-
wiz_trader-0.9.0.dist-info/METADATA,sha256=sfnuzoMTsXBeUYdnJ7-Bns7116N5VErpbiIsFfkkigU,4281
|
7
|
-
wiz_trader-0.9.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
-
wiz_trader-0.9.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
|
9
|
-
wiz_trader-0.9.0.dist-info/RECORD,,
|
File without changes
|