wiz-trader 0.2.0__tar.gz → 0.4.0__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.
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.2
2
+ Name: wiz_trader
3
+ Version: 0.4.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.
@@ -0,0 +1,138 @@
1
+ # WizTrader SDK
2
+
3
+ A Python SDK for connecting to the Wizzer trading platform.
4
+
5
+ ## Installation
6
+
7
+ You can install the package directly from PyPI:
8
+
9
+ ```bash
10
+ pip install wiz_trader
11
+ ```
12
+
13
+ ## Features
14
+
15
+ - Real-time market data through WebSocket connection
16
+ - REST API for accessing market data and indices
17
+ - Automatic WebSocket reconnection with exponential backoff
18
+ - Subscribe/unsubscribe to instruments
19
+ - Customizable logging levels
20
+
21
+ ## Quick Start - Quotes Client
22
+
23
+ ```python
24
+ import asyncio
25
+ from wiz_trader import QuotesClient
26
+
27
+ # Callback function to process market data
28
+ def process_tick(data):
29
+ print(f"Received tick: {data}")
30
+
31
+ async def main():
32
+ # Initialize client with direct parameters
33
+ client = QuotesClient(
34
+ base_url="wss://websocket-url/quotes",
35
+ token="your-jwt-token",
36
+ log_level="info" # Options: "error", "info", "debug"
37
+ )
38
+
39
+ # Set callback
40
+ client.on_tick = process_tick
41
+
42
+ # Connect in the background
43
+ connection_task = asyncio.create_task(client.connect())
44
+
45
+ # Subscribe to instruments
46
+ await client.subscribe(["NSE:SBIN:3045"])
47
+
48
+ # Keep the connection running
49
+ try:
50
+ await asyncio.sleep(3600) # Run for 1 hour
51
+ except KeyboardInterrupt:
52
+ # Unsubscribe and close
53
+ await client.unsubscribe(["NSE:SBIN:3045"])
54
+ await client.close()
55
+
56
+ await connection_task
57
+
58
+ if __name__ == "__main__":
59
+ asyncio.run(main())
60
+ ```
61
+
62
+ ## Quick Start - DataHub Client
63
+
64
+ ```python
65
+ from wiz_trader import WizzerClient
66
+
67
+ # Initialize client
68
+ client = WizzerClient(
69
+ base_url="https://api-url.in",
70
+ token="your-jwt-token",
71
+ log_level="info" # Options: "error", "info", "debug"
72
+ )
73
+
74
+ # Get list of indices
75
+ indices = client.get_indices(exchange="NSE")
76
+ print(indices)
77
+
78
+ # Get index components
79
+ components = client.get_index_components(
80
+ trading_symbol="NIFTY 50",
81
+ exchange="NSE"
82
+ )
83
+ print(components)
84
+
85
+ # Get historical OHLCV data
86
+ historical_data = client.get_historical_ohlcv(
87
+ instruments=["NSE:SBIN:3045"],
88
+ start_date="2024-01-01",
89
+ end_date="2024-01-31",
90
+ ohlcv=["open", "high", "low", "close", "volume"]
91
+ )
92
+ print(historical_data)
93
+ ```
94
+
95
+ ## Configuration
96
+
97
+ You can configure the clients in two ways:
98
+
99
+ 1. **Direct parameter passing** (recommended):
100
+ ```python
101
+ quotes_client = QuotesClient(
102
+ base_url="wss://websocket-url/quotes",
103
+ token="your-jwt-token",
104
+ log_level="info"
105
+ )
106
+
107
+ wizzer_client = WizzerClient(
108
+ base_url="https://api-url.in",
109
+ token="your-jwt-token",
110
+ log_level="info"
111
+ )
112
+ ```
113
+
114
+ 2. **System environment variables**:
115
+ - `WZ__QUOTES_BASE_URL`: WebSocket URL for the quotes server
116
+ - `WZ__API_BASE_URL`: Base URL for the Wizzer's REST API
117
+ - `WZ__TOKEN`: JWT token for authentication
118
+
119
+ ```python
120
+ # The clients will automatically use the environment variables if parameters are not provided
121
+ quotes_client = QuotesClient(log_level="info")
122
+ wizzer_client = WizzerClient(log_level="info")
123
+ ```
124
+
125
+ ## Advanced Usage
126
+
127
+ Check the `examples/` directory for more detailed examples:
128
+
129
+ - `example_manual.py`: Demonstrates direct configuration with parameters
130
+ - `example_wizzer.py`: Demonstrates usage of the Wizzer client
131
+
132
+ ## License
133
+
134
+ This project is licensed under the MIT License - see the LICENSE file for details.
135
+
136
+ ## Contributing
137
+
138
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -4,27 +4,28 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wiz_trader"
7
- version = "0.2.0"
7
+ version = "0.4.0"
8
8
  description = "A Python SDK for connecting to the Wizzer."
9
9
  readme = "README.md"
10
10
  authors = [
11
- {name = "Pawan Wagh", email = "pawan@wizzer.in"},
11
+ {name = "Pawan Wagh", email = "pawan@wizzer.in"},
12
12
  ]
13
13
  license = {text = "MIT"}
14
14
  classifiers = [
15
- "Development Status :: 3 - Alpha",
16
- "Intended Audience :: Financial and Insurance Industry",
17
- "Intended Audience :: Developers",
18
- "Programming Language :: Python :: 3",
19
- "Operating System :: OS Independent",
20
- "License :: OSI Approved :: MIT License",
21
- "Topic :: Office/Business :: Financial",
22
- "Topic :: Software Development :: Libraries :: Python Modules",
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Financial and Insurance Industry",
17
+ "Intended Audience :: Developers",
18
+ "Programming Language :: Python :: 3",
19
+ "Operating System :: OS Independent",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Topic :: Office/Business :: Financial",
22
+ "Topic :: Software Development :: Libraries :: Python Modules",
23
23
  ]
24
24
  keywords = ["finance", "trading", "sdk"]
25
25
  requires-python = ">=3.6"
26
26
  dependencies = [
27
- "websockets",
27
+ "websockets",
28
+ "requests",
28
29
  ]
29
30
 
30
31
  [project.urls]
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='wiz_trader',
5
- version='0.2.0',
5
+ version='0.4.0',
6
6
  description='A Python SDK for connecting to the Wizzer.',
7
7
  long_description=open('README.md').read() if open('README.md') else "",
8
8
  long_description_content_type='text/markdown',
@@ -12,6 +12,7 @@ setup(
12
12
  packages=find_packages(),
13
13
  install_requires=[
14
14
  'websockets',
15
+ 'requests',
15
16
  'python-dotenv'
16
17
  ],
17
18
  classifiers=[
@@ -0,0 +1,8 @@
1
+ """WizTrader SDK for connecting to the Wizzer."""
2
+
3
+ from .quotes import QuotesClient
4
+ from .apis import WizzerClient
5
+
6
+ __version__ = "0.4.0"
7
+
8
+ __all__ = ["QuotesClient", "WizzerClient"]
@@ -0,0 +1,6 @@
1
+ # apis/__init__.py
2
+ """Module for REST API integrations with Wizzer."""
3
+
4
+ from .client import WizzerClient
5
+
6
+ __all__ = ["WizzerClient"]