wiz-trader 0.1.0__tar.gz → 0.2.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,7 @@
1
+ include LICENSE
2
+ include README.md
3
+ exclude .env
4
+ global-exclude __pycache__
5
+ global-exclude *.py[cod]
6
+ global-exclude *.so
7
+ global-exclude .DS_Store
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.2
2
+ Name: wiz_trader
3
+ Version: 0.2.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
+ Dynamic: author
24
+ Dynamic: home-page
25
+ Dynamic: requires-python
26
+
27
+ # WizTrader SDK
28
+
29
+ A Python SDK for connecting to the Wizzer trading platform.
30
+
31
+ ## Installation
32
+
33
+ You can install the package directly from PyPI:
34
+
35
+ ```bash
36
+ pip install wiz_trader
37
+ ```
38
+
39
+ ## Features
40
+
41
+ - Real-time market data through WebSocket connection
42
+ - Automatic reconnection with exponential backoff
43
+ - Subscribe/unsubscribe to instruments
44
+ - Customizable logging levels
45
+
46
+ ## Quick Start
47
+
48
+ ```python
49
+ import asyncio
50
+ from wiz_trader import QuotesClient
51
+
52
+ # Callback function to process market data
53
+ def process_tick(data):
54
+ print(f"Received tick: {data}")
55
+
56
+ async def main():
57
+ # Initialize client with direct parameters
58
+ client = QuotesClient(
59
+ base_url="wss://your-websocket-url.com/quotes",
60
+ token="your-jwt-token",
61
+ log_level="info" # Options: "error", "info", "debug"
62
+ )
63
+
64
+ # Set callback
65
+ client.on_tick = process_tick
66
+
67
+ # Connect in the background
68
+ connection_task = asyncio.create_task(client.connect())
69
+
70
+ # Subscribe to instruments
71
+ await client.subscribe(["NSE:SBIN:3045"])
72
+
73
+ # Keep the connection running
74
+ try:
75
+ await asyncio.sleep(3600) # Run for 1 hour
76
+ except KeyboardInterrupt:
77
+ # Unsubscribe and close
78
+ await client.unsubscribe(["NSE:SBIN:3045"])
79
+ await client.close()
80
+
81
+ await connection_task
82
+
83
+ if __name__ == "__main__":
84
+ asyncio.run(main())
85
+ ```
86
+
87
+ ## Configuration
88
+
89
+ You can configure the client in two ways:
90
+
91
+ 1. **Direct parameter passing** (recommended):
92
+ ```python
93
+ client = QuotesClient(
94
+ base_url="wss://your-websocket-url.com/quotes",
95
+ token="your-jwt-token",
96
+ log_level="info"
97
+ )
98
+ ```
99
+
100
+ 2. **System environment variables**:
101
+ - `WZ__QUOTES_BASE_URL`: WebSocket URL for the quotes server
102
+ - `WZ__TOKEN`: JWT token for authentication
103
+
104
+ ```python
105
+ # The client will automatically use the environment variables if parameters are not provided
106
+ client = QuotesClient(log_level="info")
107
+ ```
108
+
109
+ ## Advanced Usage
110
+
111
+ Check the `examples/` directory for more detailed examples:
112
+
113
+ - `example_manual.py`: Demonstrates direct configuration with parameters
114
+
115
+ ## License
116
+
117
+ This project is licensed under the MIT License - see the LICENSE file for details.
118
+
119
+ ## Contributing
120
+
121
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,95 @@
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
+ - Automatic reconnection with exponential backoff
17
+ - Subscribe/unsubscribe to instruments
18
+ - Customizable logging levels
19
+
20
+ ## Quick Start
21
+
22
+ ```python
23
+ import asyncio
24
+ from wiz_trader import QuotesClient
25
+
26
+ # Callback function to process market data
27
+ def process_tick(data):
28
+ print(f"Received tick: {data}")
29
+
30
+ async def main():
31
+ # Initialize client with direct parameters
32
+ client = QuotesClient(
33
+ base_url="wss://your-websocket-url.com/quotes",
34
+ token="your-jwt-token",
35
+ log_level="info" # Options: "error", "info", "debug"
36
+ )
37
+
38
+ # Set callback
39
+ client.on_tick = process_tick
40
+
41
+ # Connect in the background
42
+ connection_task = asyncio.create_task(client.connect())
43
+
44
+ # Subscribe to instruments
45
+ await client.subscribe(["NSE:SBIN:3045"])
46
+
47
+ # Keep the connection running
48
+ try:
49
+ await asyncio.sleep(3600) # Run for 1 hour
50
+ except KeyboardInterrupt:
51
+ # Unsubscribe and close
52
+ await client.unsubscribe(["NSE:SBIN:3045"])
53
+ await client.close()
54
+
55
+ await connection_task
56
+
57
+ if __name__ == "__main__":
58
+ asyncio.run(main())
59
+ ```
60
+
61
+ ## Configuration
62
+
63
+ You can configure the client in two ways:
64
+
65
+ 1. **Direct parameter passing** (recommended):
66
+ ```python
67
+ client = QuotesClient(
68
+ base_url="wss://your-websocket-url.com/quotes",
69
+ token="your-jwt-token",
70
+ log_level="info"
71
+ )
72
+ ```
73
+
74
+ 2. **System environment variables**:
75
+ - `WZ__QUOTES_BASE_URL`: WebSocket URL for the quotes server
76
+ - `WZ__TOKEN`: JWT token for authentication
77
+
78
+ ```python
79
+ # The client will automatically use the environment variables if parameters are not provided
80
+ client = QuotesClient(log_level="info")
81
+ ```
82
+
83
+ ## Advanced Usage
84
+
85
+ Check the `examples/` directory for more detailed examples:
86
+
87
+ - `example_manual.py`: Demonstrates direct configuration with parameters
88
+
89
+ ## License
90
+
91
+ This project is licensed under the MIT License - see the LICENSE file for details.
92
+
93
+ ## Contributing
94
+
95
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "wiz_trader"
7
+ version = "0.2.0"
8
+ description = "A Python SDK for connecting to the Wizzer."
9
+ readme = "README.md"
10
+ authors = [
11
+ {name = "Pawan Wagh", email = "pawan@wizzer.in"},
12
+ ]
13
+ license = {text = "MIT"}
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",
23
+ ]
24
+ keywords = ["finance", "trading", "sdk"]
25
+ requires-python = ">=3.6"
26
+ dependencies = [
27
+ "websockets",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://bitbucket.org/wizzer-tech/quotes_sdk.git"
32
+ "Bug Tracker" = "https://bitbucket.org/wizzer-tech/quotes_sdk/issues"
33
+
34
+ [tool.setuptools]
35
+ package-dir = {"" = "src"}
36
+
37
+ [tool.setuptools.packages.find]
38
+ where = ["src"]
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='wiz_trader',
5
- version='0.1.0',
5
+ version='0.2.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',
@@ -0,0 +1,7 @@
1
+ """WizTrader SDK for connecting to the Wizzer."""
2
+
3
+ from .quotes import QuotesClient
4
+
5
+ __version__ = "0.2.0"
6
+
7
+ __all__ = ["QuotesClient"]
@@ -1,3 +1,5 @@
1
1
  # apis/__init__.py
2
2
  # Provision for REST API functionalities in future.
3
3
  # Currently, no APIs are implemented.
4
+
5
+ """Module for REST API integrations (future functionality)."""
@@ -0,0 +1,5 @@
1
+ """Quotes module for real-time market data."""
2
+
3
+ from .client import QuotesClient
4
+
5
+ __all__ = ["QuotesClient"]
@@ -8,10 +8,6 @@ from typing import Callable, List, Optional
8
8
  import websockets
9
9
  from websockets.exceptions import ConnectionClosed
10
10
  from websockets.protocol import State
11
- from dotenv import load_dotenv
12
-
13
- # Load environment variables from .env (if available)
14
- load_dotenv()
15
11
 
16
12
  # Setup module-level logger with a default handler if none exists.
17
13
  logger = logging.getLogger(__name__)
@@ -46,8 +42,9 @@ class QuotesClient:
46
42
  logger.setLevel(valid_levels[log_level])
47
43
 
48
44
  self.log_level = log_level
49
- self.base_url = base_url or os.getenv("WZ__QUOTES_BASE_URL")
50
- self.token = token or os.getenv("WZ__TOKEN")
45
+ # System env vars take precedence over .env
46
+ self.base_url = base_url or os.environ.get("WZ__QUOTES_BASE_URL")
47
+ self.token = token or os.environ.get("WZ__TOKEN")
51
48
  if not self.token:
52
49
  raise ValueError("JWT token must be provided as an argument or in .env (WZ__TOKEN)")
53
50
  if not self.base_url:
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.2
2
+ Name: wiz_trader
3
+ Version: 0.2.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
+ Dynamic: author
24
+ Dynamic: home-page
25
+ Dynamic: requires-python
26
+
27
+ # WizTrader SDK
28
+
29
+ A Python SDK for connecting to the Wizzer trading platform.
30
+
31
+ ## Installation
32
+
33
+ You can install the package directly from PyPI:
34
+
35
+ ```bash
36
+ pip install wiz_trader
37
+ ```
38
+
39
+ ## Features
40
+
41
+ - Real-time market data through WebSocket connection
42
+ - Automatic reconnection with exponential backoff
43
+ - Subscribe/unsubscribe to instruments
44
+ - Customizable logging levels
45
+
46
+ ## Quick Start
47
+
48
+ ```python
49
+ import asyncio
50
+ from wiz_trader import QuotesClient
51
+
52
+ # Callback function to process market data
53
+ def process_tick(data):
54
+ print(f"Received tick: {data}")
55
+
56
+ async def main():
57
+ # Initialize client with direct parameters
58
+ client = QuotesClient(
59
+ base_url="wss://your-websocket-url.com/quotes",
60
+ token="your-jwt-token",
61
+ log_level="info" # Options: "error", "info", "debug"
62
+ )
63
+
64
+ # Set callback
65
+ client.on_tick = process_tick
66
+
67
+ # Connect in the background
68
+ connection_task = asyncio.create_task(client.connect())
69
+
70
+ # Subscribe to instruments
71
+ await client.subscribe(["NSE:SBIN:3045"])
72
+
73
+ # Keep the connection running
74
+ try:
75
+ await asyncio.sleep(3600) # Run for 1 hour
76
+ except KeyboardInterrupt:
77
+ # Unsubscribe and close
78
+ await client.unsubscribe(["NSE:SBIN:3045"])
79
+ await client.close()
80
+
81
+ await connection_task
82
+
83
+ if __name__ == "__main__":
84
+ asyncio.run(main())
85
+ ```
86
+
87
+ ## Configuration
88
+
89
+ You can configure the client in two ways:
90
+
91
+ 1. **Direct parameter passing** (recommended):
92
+ ```python
93
+ client = QuotesClient(
94
+ base_url="wss://your-websocket-url.com/quotes",
95
+ token="your-jwt-token",
96
+ log_level="info"
97
+ )
98
+ ```
99
+
100
+ 2. **System environment variables**:
101
+ - `WZ__QUOTES_BASE_URL`: WebSocket URL for the quotes server
102
+ - `WZ__TOKEN`: JWT token for authentication
103
+
104
+ ```python
105
+ # The client will automatically use the environment variables if parameters are not provided
106
+ client = QuotesClient(log_level="info")
107
+ ```
108
+
109
+ ## Advanced Usage
110
+
111
+ Check the `examples/` directory for more detailed examples:
112
+
113
+ - `example_manual.py`: Demonstrates direct configuration with parameters
114
+
115
+ ## License
116
+
117
+ This project is licensed under the MIT License - see the LICENSE file for details.
118
+
119
+ ## Contributing
120
+
121
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,16 @@
1
+ MANIFEST.in
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ src/wiz_trader/__init__.py
6
+ src/wiz_trader.egg-info/PKG-INFO
7
+ src/wiz_trader.egg-info/SOURCES.txt
8
+ src/wiz_trader.egg-info/dependency_links.txt
9
+ src/wiz_trader.egg-info/requires.txt
10
+ src/wiz_trader.egg-info/top_level.txt
11
+ src/wiz_trader/apis/__init__.py
12
+ src/wiz_trader/apis/client.py
13
+ src/wiz_trader/quotes/__init__.py
14
+ src/wiz_trader/quotes/client.py
15
+ tests/test_apis.py
16
+ tests/test_quotes.py
@@ -0,0 +1 @@
1
+ websockets
@@ -0,0 +1 @@
1
+ wiz_trader
@@ -1 +0,0 @@
1
- exclude .env
wiz_trader-0.1.0/PKG-INFO DELETED
@@ -1,43 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: wiz_trader
3
- Version: 0.1.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@wizzer.in
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: Intended Audience :: Financial and Insurance Industry
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Operating System :: OS Independent
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Topic :: Office/Business :: Financial
15
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
- Requires-Python: >=3.6
17
- Description-Content-Type: text/markdown
18
- Requires-Dist: websockets
19
- Requires-Dist: python-dotenv
20
- Dynamic: author
21
- Dynamic: author-email
22
- Dynamic: classifier
23
- Dynamic: description
24
- Dynamic: description-content-type
25
- Dynamic: home-page
26
- Dynamic: requires-dist
27
- Dynamic: requires-python
28
- Dynamic: summary
29
-
30
- # WizTrader SDK
31
-
32
- A Python SDK for connecting to the Wizzer.
33
-
34
- ## Installation
35
-
36
- Install the dependencies:
37
- ```
38
- pip install -r requirements.txt
39
- ```
40
-
41
- ## Usage Example
42
-
43
- See `example.py` for a complete example.
@@ -1,14 +0,0 @@
1
- # WizTrader SDK
2
-
3
- A Python SDK for connecting to the Wizzer.
4
-
5
- ## Installation
6
-
7
- Install the dependencies:
8
- ```
9
- pip install -r requirements.txt
10
- ```
11
-
12
- ## Usage Example
13
-
14
- See `example.py` for a complete example.
@@ -1,3 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=42", "wheel"]
3
- build-backend = "setuptools.build_meta"
@@ -1,5 +0,0 @@
1
- from .client import QuotesClient
2
-
3
- __version__ = "0.1.0"
4
-
5
- __all__ = ["QuotesClient", "__version__"]
@@ -1,43 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: wiz_trader
3
- Version: 0.1.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@wizzer.in
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: Intended Audience :: Financial and Insurance Industry
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Operating System :: OS Independent
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Topic :: Office/Business :: Financial
15
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
- Requires-Python: >=3.6
17
- Description-Content-Type: text/markdown
18
- Requires-Dist: websockets
19
- Requires-Dist: python-dotenv
20
- Dynamic: author
21
- Dynamic: author-email
22
- Dynamic: classifier
23
- Dynamic: description
24
- Dynamic: description-content-type
25
- Dynamic: home-page
26
- Dynamic: requires-dist
27
- Dynamic: requires-python
28
- Dynamic: summary
29
-
30
- # WizTrader SDK
31
-
32
- A Python SDK for connecting to the Wizzer.
33
-
34
- ## Installation
35
-
36
- Install the dependencies:
37
- ```
38
- pip install -r requirements.txt
39
- ```
40
-
41
- ## Usage Example
42
-
43
- See `example.py` for a complete example.
@@ -1,15 +0,0 @@
1
- MANIFEST.in
2
- README.md
3
- pyproject.toml
4
- setup.py
5
- apis/__init__.py
6
- apis/client.py
7
- tests/test_apis.py
8
- tests/test_quotes.py
9
- ticker/__init__.py
10
- ticker/client.py
11
- wiz_trader.egg-info/PKG-INFO
12
- wiz_trader.egg-info/SOURCES.txt
13
- wiz_trader.egg-info/dependency_links.txt
14
- wiz_trader.egg-info/requires.txt
15
- wiz_trader.egg-info/top_level.txt
@@ -1,2 +0,0 @@
1
- websockets
2
- python-dotenv
@@ -1,2 +0,0 @@
1
- apis
2
- ticker
File without changes