Tradehull-Delta-Exchange 0.0.5__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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 TradeHull
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files, to deal in the Software
7
+ without restriction, including without limitation the rights to use, copy,
8
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the
9
+ Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,318 @@
1
+ Metadata-Version: 2.1
2
+ Name: Tradehull-Delta-Exchange
3
+ Version: 0.0.5
4
+ Summary: TradeHull Delta Exchange API wrapper for market data, option chain, and order placement.
5
+ Author: TradeHull, Jigyanshu Sharma
6
+ Maintainer: Jigyanshu Sharma
7
+ License: MIT
8
+ Project-URL: Homepage, https://tradehull.com
9
+ Project-URL: Documentation, https://tradehull.com
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: Office/Business :: Financial
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE.txt
17
+ Requires-Dist: aiohttp
18
+ Requires-Dist: pandas
19
+ Requires-Dist: requests
20
+
21
+ # Tradehull Delta Exchange
22
+
23
+ Tradehull Delta Exchange is a Python wrapper for Delta Exchange India API.
24
+
25
+ It supports market data, LTP, OHLC historical candles, option-chain data, account information, wallet balance, open positions, order placement, bracket orders, order cancellation, and position closing.
26
+
27
+ ## Installation from TestPyPI
28
+
29
+ For testing installation from TestPyPI, use:
30
+
31
+ ```bash
32
+ python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple Tradehull-Delta-Exchange==0.0.5
33
+ ```
34
+
35
+ Note: `--extra-index-url https://pypi.org/simple` is required because dependencies like `aiohttp`, `pandas`, and `requests` are downloaded from real PyPI.
36
+
37
+
38
+ ## Upgrade
39
+
40
+ ```bash
41
+ pip install --upgrade Tradehull-Delta-Exchange
42
+ ```
43
+
44
+ ## Import
45
+
46
+ ```python
47
+ from tradehull_delta_exchange import Tradehull
48
+ ```
49
+
50
+ ## Authentication
51
+
52
+ ```python
53
+ from tradehull_delta_exchange import Tradehull
54
+
55
+ api_key = "YOUR_API_KEY"
56
+ api_secret = "YOUR_API_SECRET"
57
+
58
+ tdx = Tradehull(
59
+ api_key=api_key,
60
+ api_secret=api_secret
61
+ )
62
+ ```
63
+
64
+ You can also use environment variables:
65
+
66
+ ```bash
67
+ set DELTA_API_KEY=YOUR_API_KEY
68
+ set DELTA_API_SECRET=YOUR_API_SECRET
69
+ ```
70
+
71
+ Then:
72
+
73
+ ```python
74
+ from tradehull_delta_exchange import Tradehull
75
+
76
+ tdx = Tradehull()
77
+ ```
78
+
79
+ ## Get LTP
80
+
81
+ ```python
82
+ from tradehull_delta_exchange import Tradehull
83
+
84
+ tdx = Tradehull(
85
+ api_key="YOUR_API_KEY",
86
+ api_secret="YOUR_API_SECRET"
87
+ )
88
+
89
+ ltp = tdx.get_ltp("BTCUSD")
90
+ print(ltp)
91
+ ```
92
+
93
+ ## Get Full Quote
94
+
95
+ ```python
96
+ quote = tdx.get_quote("BTCUSD")
97
+ print(quote)
98
+ ```
99
+
100
+ ## Get OHLC Historical Data
101
+
102
+ ```python
103
+ df = tdx.get_chart(
104
+ name="BTCUSD",
105
+ timeframe="15minute",
106
+ days=7
107
+ )
108
+
109
+ print(df.tail())
110
+ ```
111
+
112
+ Supported timeframe examples:
113
+
114
+ ```text
115
+ 1minute
116
+ 3minute
117
+ 5minute
118
+ 15minute
119
+ 30minute
120
+ 60minute
121
+ day
122
+ week
123
+ ```
124
+
125
+ ## Get Option Chain
126
+
127
+ ```python
128
+ option_chain = tdx.get_option_chain(
129
+ underlying="BTC",
130
+ expiry_date=0,
131
+ limit=20,
132
+ view="broker"
133
+ )
134
+
135
+ print(option_chain)
136
+ ```
137
+
138
+ ## Get Call Option Chain
139
+
140
+ ```python
141
+ call_df = tdx.get_option_chain(
142
+ underlying="BTC",
143
+ expiry_date=0,
144
+ limit=20,
145
+ view="call"
146
+ )
147
+
148
+ print(call_df)
149
+ ```
150
+
151
+ ## Get Put Option Chain
152
+
153
+ ```python
154
+ put_df = tdx.get_option_chain(
155
+ underlying="BTC",
156
+ expiry_date=0,
157
+ limit=20,
158
+ view="put"
159
+ )
160
+
161
+ print(put_df)
162
+ ```
163
+
164
+ ## Get Combined Option Chain
165
+
166
+ ```python
167
+ combined_df = tdx.get_option_chain(
168
+ underlying="BTC",
169
+ expiry_date=0,
170
+ limit=20,
171
+ view="combine"
172
+ )
173
+
174
+ print(combined_df)
175
+ ```
176
+
177
+ ## Get ATM Option Name
178
+
179
+ ```python
180
+ option_name = tdx.get_option_name(
181
+ symbolname="BTC",
182
+ moneyness=0,
183
+ right="CE",
184
+ expiry=0
185
+ )
186
+
187
+ print(option_name)
188
+ ```
189
+
190
+ ## Get ITM Option
191
+
192
+ ```python
193
+ itm_option = tdx.get_itm_option(
194
+ underlying="BTC",
195
+ itm_level=1,
196
+ expiry_date=0
197
+ )
198
+
199
+ print(itm_option)
200
+ ```
201
+
202
+ ## Account Information
203
+
204
+ ```python
205
+ profile = tdx.get_profile()
206
+ print(profile)
207
+
208
+ wallet = tdx.get_wallet_balance()
209
+ print(wallet)
210
+
211
+ positions = tdx.get_open_positions()
212
+ print(positions)
213
+ ```
214
+
215
+ ## Place Market Order
216
+
217
+ Live order placement is disabled by default in the safe wrapper.
218
+
219
+ To place a real order, you must intentionally pass:
220
+
221
+ Example:
222
+
223
+ ```python
224
+ order = tdx.place_order(
225
+ symbol="BTCUSD",
226
+ side="buy",
227
+ order_type="market_order",
228
+ quantity=1,price=None)
229
+
230
+ print(order)
231
+ ```
232
+
233
+ ## Place Bracket Order
234
+
235
+ ```python
236
+ result = tdx.place_bracket_order(
237
+ symbol="BTCUSD",
238
+ side="buy",
239
+ quantity=1,
240
+ entry_price=None,
241
+ target_price=72000,
242
+ sl_price=61000,
243
+ sl_limit_price=60950,
244
+ target_limit_price=72000
245
+ )
246
+
247
+ print(result)
248
+ ```
249
+
250
+ ## Cancel Order
251
+
252
+ ```python
253
+
254
+ cancel_status = tdx.cancel_order(
255
+ order_id=123456,
256
+ product_id=27,
257
+ )
258
+
259
+ print(cancel_status)
260
+ ```
261
+
262
+
263
+ ## Close All Orders and Positions
264
+
265
+ ```python
266
+ result = tdx.close_all_orders()
267
+
268
+ print(result)
269
+ ```
270
+
271
+ ## Safety Warning
272
+
273
+ This package can place real orders on Delta Exchange.
274
+
275
+ Use live trading functions carefully.
276
+
277
+ Always test with small quantity first.
278
+
279
+ Do not publish your API key or API secret in code, GitHub, PyPI, screenshots, or shared files.
280
+
281
+ ## Main Features
282
+
283
+ * Get LTP
284
+ * Get full quote
285
+ * Get OHLC historical candles
286
+ * Get option chain
287
+ * Get call option chain
288
+ * Get put option chain
289
+ * Get combined option chain
290
+ * Get ATM option
291
+ * Get ITM option
292
+ * Get profile
293
+ * Get wallet balance
294
+ * Get open positions
295
+ * Place plain order
296
+ * Place bracket order
297
+ * Cancel order
298
+ * Cancel all orders
299
+ * Close open position
300
+ * Close all orders and positions
301
+
302
+ ## Basic Usage
303
+
304
+ ```python
305
+ from tradehull_delta_exchange import Tradehull
306
+
307
+ tdx = Tradehull(
308
+ api_key="YOUR_API_KEY",
309
+ api_secret="YOUR_API_SECRET"
310
+ )
311
+
312
+ ltp = tdx.get_ltp("BTCUSD")
313
+ print("BTCUSD LTP:", ltp)
314
+ ```
315
+
316
+ ## License
317
+
318
+ MIT License
@@ -0,0 +1,298 @@
1
+ # Tradehull Delta Exchange
2
+
3
+ Tradehull Delta Exchange is a Python wrapper for Delta Exchange India API.
4
+
5
+ It supports market data, LTP, OHLC historical candles, option-chain data, account information, wallet balance, open positions, order placement, bracket orders, order cancellation, and position closing.
6
+
7
+ ## Installation from TestPyPI
8
+
9
+ For testing installation from TestPyPI, use:
10
+
11
+ ```bash
12
+ python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple Tradehull-Delta-Exchange==0.0.5
13
+ ```
14
+
15
+ Note: `--extra-index-url https://pypi.org/simple` is required because dependencies like `aiohttp`, `pandas`, and `requests` are downloaded from real PyPI.
16
+
17
+
18
+ ## Upgrade
19
+
20
+ ```bash
21
+ pip install --upgrade Tradehull-Delta-Exchange
22
+ ```
23
+
24
+ ## Import
25
+
26
+ ```python
27
+ from tradehull_delta_exchange import Tradehull
28
+ ```
29
+
30
+ ## Authentication
31
+
32
+ ```python
33
+ from tradehull_delta_exchange import Tradehull
34
+
35
+ api_key = "YOUR_API_KEY"
36
+ api_secret = "YOUR_API_SECRET"
37
+
38
+ tdx = Tradehull(
39
+ api_key=api_key,
40
+ api_secret=api_secret
41
+ )
42
+ ```
43
+
44
+ You can also use environment variables:
45
+
46
+ ```bash
47
+ set DELTA_API_KEY=YOUR_API_KEY
48
+ set DELTA_API_SECRET=YOUR_API_SECRET
49
+ ```
50
+
51
+ Then:
52
+
53
+ ```python
54
+ from tradehull_delta_exchange import Tradehull
55
+
56
+ tdx = Tradehull()
57
+ ```
58
+
59
+ ## Get LTP
60
+
61
+ ```python
62
+ from tradehull_delta_exchange import Tradehull
63
+
64
+ tdx = Tradehull(
65
+ api_key="YOUR_API_KEY",
66
+ api_secret="YOUR_API_SECRET"
67
+ )
68
+
69
+ ltp = tdx.get_ltp("BTCUSD")
70
+ print(ltp)
71
+ ```
72
+
73
+ ## Get Full Quote
74
+
75
+ ```python
76
+ quote = tdx.get_quote("BTCUSD")
77
+ print(quote)
78
+ ```
79
+
80
+ ## Get OHLC Historical Data
81
+
82
+ ```python
83
+ df = tdx.get_chart(
84
+ name="BTCUSD",
85
+ timeframe="15minute",
86
+ days=7
87
+ )
88
+
89
+ print(df.tail())
90
+ ```
91
+
92
+ Supported timeframe examples:
93
+
94
+ ```text
95
+ 1minute
96
+ 3minute
97
+ 5minute
98
+ 15minute
99
+ 30minute
100
+ 60minute
101
+ day
102
+ week
103
+ ```
104
+
105
+ ## Get Option Chain
106
+
107
+ ```python
108
+ option_chain = tdx.get_option_chain(
109
+ underlying="BTC",
110
+ expiry_date=0,
111
+ limit=20,
112
+ view="broker"
113
+ )
114
+
115
+ print(option_chain)
116
+ ```
117
+
118
+ ## Get Call Option Chain
119
+
120
+ ```python
121
+ call_df = tdx.get_option_chain(
122
+ underlying="BTC",
123
+ expiry_date=0,
124
+ limit=20,
125
+ view="call"
126
+ )
127
+
128
+ print(call_df)
129
+ ```
130
+
131
+ ## Get Put Option Chain
132
+
133
+ ```python
134
+ put_df = tdx.get_option_chain(
135
+ underlying="BTC",
136
+ expiry_date=0,
137
+ limit=20,
138
+ view="put"
139
+ )
140
+
141
+ print(put_df)
142
+ ```
143
+
144
+ ## Get Combined Option Chain
145
+
146
+ ```python
147
+ combined_df = tdx.get_option_chain(
148
+ underlying="BTC",
149
+ expiry_date=0,
150
+ limit=20,
151
+ view="combine"
152
+ )
153
+
154
+ print(combined_df)
155
+ ```
156
+
157
+ ## Get ATM Option Name
158
+
159
+ ```python
160
+ option_name = tdx.get_option_name(
161
+ symbolname="BTC",
162
+ moneyness=0,
163
+ right="CE",
164
+ expiry=0
165
+ )
166
+
167
+ print(option_name)
168
+ ```
169
+
170
+ ## Get ITM Option
171
+
172
+ ```python
173
+ itm_option = tdx.get_itm_option(
174
+ underlying="BTC",
175
+ itm_level=1,
176
+ expiry_date=0
177
+ )
178
+
179
+ print(itm_option)
180
+ ```
181
+
182
+ ## Account Information
183
+
184
+ ```python
185
+ profile = tdx.get_profile()
186
+ print(profile)
187
+
188
+ wallet = tdx.get_wallet_balance()
189
+ print(wallet)
190
+
191
+ positions = tdx.get_open_positions()
192
+ print(positions)
193
+ ```
194
+
195
+ ## Place Market Order
196
+
197
+ Live order placement is disabled by default in the safe wrapper.
198
+
199
+ To place a real order, you must intentionally pass:
200
+
201
+ Example:
202
+
203
+ ```python
204
+ order = tdx.place_order(
205
+ symbol="BTCUSD",
206
+ side="buy",
207
+ order_type="market_order",
208
+ quantity=1,price=None)
209
+
210
+ print(order)
211
+ ```
212
+
213
+ ## Place Bracket Order
214
+
215
+ ```python
216
+ result = tdx.place_bracket_order(
217
+ symbol="BTCUSD",
218
+ side="buy",
219
+ quantity=1,
220
+ entry_price=None,
221
+ target_price=72000,
222
+ sl_price=61000,
223
+ sl_limit_price=60950,
224
+ target_limit_price=72000
225
+ )
226
+
227
+ print(result)
228
+ ```
229
+
230
+ ## Cancel Order
231
+
232
+ ```python
233
+
234
+ cancel_status = tdx.cancel_order(
235
+ order_id=123456,
236
+ product_id=27,
237
+ )
238
+
239
+ print(cancel_status)
240
+ ```
241
+
242
+
243
+ ## Close All Orders and Positions
244
+
245
+ ```python
246
+ result = tdx.close_all_orders()
247
+
248
+ print(result)
249
+ ```
250
+
251
+ ## Safety Warning
252
+
253
+ This package can place real orders on Delta Exchange.
254
+
255
+ Use live trading functions carefully.
256
+
257
+ Always test with small quantity first.
258
+
259
+ Do not publish your API key or API secret in code, GitHub, PyPI, screenshots, or shared files.
260
+
261
+ ## Main Features
262
+
263
+ * Get LTP
264
+ * Get full quote
265
+ * Get OHLC historical candles
266
+ * Get option chain
267
+ * Get call option chain
268
+ * Get put option chain
269
+ * Get combined option chain
270
+ * Get ATM option
271
+ * Get ITM option
272
+ * Get profile
273
+ * Get wallet balance
274
+ * Get open positions
275
+ * Place plain order
276
+ * Place bracket order
277
+ * Cancel order
278
+ * Cancel all orders
279
+ * Close open position
280
+ * Close all orders and positions
281
+
282
+ ## Basic Usage
283
+
284
+ ```python
285
+ from tradehull_delta_exchange import Tradehull
286
+
287
+ tdx = Tradehull(
288
+ api_key="YOUR_API_KEY",
289
+ api_secret="YOUR_API_SECRET"
290
+ )
291
+
292
+ ltp = tdx.get_ltp("BTCUSD")
293
+ print("BTCUSD LTP:", ltp)
294
+ ```
295
+
296
+ ## License
297
+
298
+ MIT License
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61,<76", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "Tradehull-Delta-Exchange"
7
+ version = "0.0.5"
8
+ description = "TradeHull Delta Exchange API wrapper for market data, option chain, and order placement."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+
13
+ authors = [
14
+ { name = "TradeHull" },
15
+ { name = "Jigyanshu Sharma" }
16
+ ]
17
+
18
+ maintainers = [
19
+ { name = "Jigyanshu Sharma" }
20
+ ]
21
+
22
+ dependencies = [
23
+ "aiohttp",
24
+ "pandas",
25
+ "requests"
26
+ ]
27
+
28
+ classifiers = [
29
+ "Programming Language :: Python :: 3",
30
+ "Operating System :: OS Independent",
31
+ "Topic :: Office/Business :: Financial",
32
+ "Topic :: Software Development :: Libraries :: Python Modules"
33
+ ]
34
+
35
+ [project.urls]
36
+ Homepage = "https://tradehull.com"
37
+ Documentation = "https://tradehull.com"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+