upstox-python-sdk 2.0.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.
- upstox-python-sdk-2.0.0/LICENSE.txt +7 -0
- upstox-python-sdk-2.0.0/PKG-INFO +197 -0
- upstox-python-sdk-2.0.0/README.md +187 -0
- upstox-python-sdk-2.0.0/setup.cfg +8 -0
- upstox-python-sdk-2.0.0/setup.py +43 -0
- upstox-python-sdk-2.0.0/test/__init__.py +1 -0
- upstox-python-sdk-2.0.0/test/sanity_test.py +369 -0
- upstox-python-sdk-2.0.0/test/test_api_gateway_error_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_brokerage_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_brokerage_taxes.py +39 -0
- upstox-python-sdk-2.0.0/test/test_brokerage_wrapper_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_cancel_order_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_cancel_order_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_charge_api.py +40 -0
- upstox-python-sdk-2.0.0/test/test_convert_position_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_convert_position_request.py +39 -0
- upstox-python-sdk-2.0.0/test/test_convert_position_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_depth.py +39 -0
- upstox-python-sdk-2.0.0/test/test_depth_map.py +39 -0
- upstox-python-sdk-2.0.0/test/test_dp_plan.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_brokerage_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_full_market_quote_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_historical_candle_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_holdings_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_intra_day_candle_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_market_quote_last_traded_price_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_market_quote_ohlc_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_order_book_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_order_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_position_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_profile_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_profit_and_loss_charges_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_trade_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_trade_wise_profit_and_loss_data_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_trade_wise_profit_and_loss_meta_data_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_get_user_fund_margin_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_historical_candle_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_history_api.py +54 -0
- upstox-python-sdk-2.0.0/test/test_holdings_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_intra_day_candle_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_login_api.py +54 -0
- upstox-python-sdk-2.0.0/test/test_logout_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_market_quote_api.py +54 -0
- upstox-python-sdk-2.0.0/test/test_market_quote_ohlc.py +39 -0
- upstox-python-sdk-2.0.0/test/test_market_quote_symbol.py +39 -0
- upstox-python-sdk-2.0.0/test/test_market_quote_symbol_ltp.py +39 -0
- upstox-python-sdk-2.0.0/test/test_modify_order_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_modify_order_request.py +39 -0
- upstox-python-sdk-2.0.0/test/test_modify_order_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_o_auth_client_exception.py +39 -0
- upstox-python-sdk-2.0.0/test/test_o_auth_client_exception_cause.py +39 -0
- upstox-python-sdk-2.0.0/test/test_o_auth_client_exception_cause_stack_trace.py +39 -0
- upstox-python-sdk-2.0.0/test/test_o_auth_client_exception_cause_suppressed.py +39 -0
- upstox-python-sdk-2.0.0/test/test_ohlc.py +39 -0
- upstox-python-sdk-2.0.0/test/test_order_api.py +82 -0
- upstox-python-sdk-2.0.0/test/test_order_book_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_order_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_other_taxes.py +39 -0
- upstox-python-sdk-2.0.0/test/test_place_order_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_place_order_request.py +39 -0
- upstox-python-sdk-2.0.0/test/test_place_order_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_portfolio_api.py +54 -0
- upstox-python-sdk-2.0.0/test/test_position_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_problem.py +39 -0
- upstox-python-sdk-2.0.0/test/test_profile_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_profit_and_loss_charges_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_profit_and_loss_charges_taxes.py +39 -0
- upstox-python-sdk-2.0.0/test/test_profit_and_loss_charges_wrapper_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_profit_and_loss_meta_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_profit_and_loss_meta_data_wrapper.py +39 -0
- upstox-python-sdk-2.0.0/test/test_profit_and_loss_other_charges_taxes.py +39 -0
- upstox-python-sdk-2.0.0/test/test_token_request.py +39 -0
- upstox-python-sdk-2.0.0/test/test_token_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_trade_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_trade_profit_and_loss_api.py +54 -0
- upstox-python-sdk-2.0.0/test/test_trade_wise_meta_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_trade_wise_profit_and_loss_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_user_api.py +47 -0
- upstox-python-sdk-2.0.0/test/test_user_fund_margin_data.py +39 -0
- upstox-python-sdk-2.0.0/test/test_websocket_api.py +61 -0
- upstox-python-sdk-2.0.0/test/test_websocket_auth_redirect_response.py +39 -0
- upstox-python-sdk-2.0.0/test/test_websocket_auth_redirect_response_data.py +39 -0
- upstox-python-sdk-2.0.0/upstox_client/__init__.py +96 -0
- upstox-python-sdk-2.0.0/upstox_client/api/__init__.py +14 -0
- upstox-python-sdk-2.0.0/upstox_client/api/charge_api.py +168 -0
- upstox-python-sdk-2.0.0/upstox_client/api/history_api.py +390 -0
- upstox-python-sdk-2.0.0/upstox_client/api/login_api.py +366 -0
- upstox-python-sdk-2.0.0/upstox_client/api/market_quote_api.py +350 -0
- upstox-python-sdk-2.0.0/upstox_client/api/order_api.py +746 -0
- upstox-python-sdk-2.0.0/upstox_client/api/portfolio_api.py +330 -0
- upstox-python-sdk-2.0.0/upstox_client/api/trade_profit_and_loss_api.py +406 -0
- upstox-python-sdk-2.0.0/upstox_client/api/user_api.py +227 -0
- upstox-python-sdk-2.0.0/upstox_client/api/websocket_api.py +413 -0
- upstox-python-sdk-2.0.0/upstox_client/api_client.py +632 -0
- upstox-python-sdk-2.0.0/upstox_client/configuration.py +253 -0
- upstox-python-sdk-2.0.0/upstox_client/models/__init__.py +82 -0
- upstox-python-sdk-2.0.0/upstox_client/models/api_gateway_error_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/brokerage_data.py +218 -0
- upstox-python-sdk-2.0.0/upstox_client/models/brokerage_taxes.py +168 -0
- upstox-python-sdk-2.0.0/upstox_client/models/brokerage_wrapper_data.py +110 -0
- upstox-python-sdk-2.0.0/upstox_client/models/cancel_order_data.py +112 -0
- upstox-python-sdk-2.0.0/upstox_client/models/cancel_order_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/convert_position_data.py +112 -0
- upstox-python-sdk-2.0.0/upstox_client/models/convert_position_request.py +247 -0
- upstox-python-sdk-2.0.0/upstox_client/models/convert_position_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/depth.py +168 -0
- upstox-python-sdk-2.0.0/upstox_client/models/depth_map.py +140 -0
- upstox-python-sdk-2.0.0/upstox_client/models/dp_plan.py +140 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_brokerage_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_full_market_quote_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_historical_candle_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_holdings_response.py +144 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_intra_day_candle_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_market_quote_last_traded_price_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_market_quote_ohlc_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_order_book_response.py +144 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_order_response.py +144 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_position_response.py +144 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_profile_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_profit_and_loss_charges_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_trade_response.py +144 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_trade_wise_profit_and_loss_data_response.py +170 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_trade_wise_profit_and_loss_meta_data_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/get_user_fund_margin_response.py +144 -0
- upstox-python-sdk-2.0.0/upstox_client/models/historical_candle_data.py +110 -0
- upstox-python-sdk-2.0.0/upstox_client/models/holdings_data.py +620 -0
- upstox-python-sdk-2.0.0/upstox_client/models/intra_day_candle_data.py +110 -0
- upstox-python-sdk-2.0.0/upstox_client/models/logout_response.py +144 -0
- upstox-python-sdk-2.0.0/upstox_client/models/market_quote_ohlc.py +164 -0
- upstox-python-sdk-2.0.0/upstox_client/models/market_quote_symbol.py +552 -0
- upstox-python-sdk-2.0.0/upstox_client/models/market_quote_symbol_ltp.py +138 -0
- upstox-python-sdk-2.0.0/upstox_client/models/modify_order_data.py +112 -0
- upstox-python-sdk-2.0.0/upstox_client/models/modify_order_request.py +297 -0
- upstox-python-sdk-2.0.0/upstox_client/models/modify_order_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/o_auth_client_exception.py +214 -0
- upstox-python-sdk-2.0.0/upstox_client/models/o_auth_client_exception_cause.py +188 -0
- upstox-python-sdk-2.0.0/upstox_client/models/o_auth_client_exception_cause_stack_trace.py +292 -0
- upstox-python-sdk-2.0.0/upstox_client/models/o_auth_client_exception_cause_suppressed.py +162 -0
- upstox-python-sdk-2.0.0/upstox_client/models/ohlc.py +196 -0
- upstox-python-sdk-2.0.0/upstox_client/models/order_book_data.py +924 -0
- upstox-python-sdk-2.0.0/upstox_client/models/order_data.py +814 -0
- upstox-python-sdk-2.0.0/upstox_client/models/other_taxes.py +168 -0
- upstox-python-sdk-2.0.0/upstox_client/models/place_order_data.py +112 -0
- upstox-python-sdk-2.0.0/upstox_client/models/place_order_request.py +426 -0
- upstox-python-sdk-2.0.0/upstox_client/models/place_order_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/position_data.py +874 -0
- upstox-python-sdk-2.0.0/upstox_client/models/problem.py +196 -0
- upstox-python-sdk-2.0.0/upstox_client/models/profile_data.py +385 -0
- upstox-python-sdk-2.0.0/upstox_client/models/profit_and_loss_charges_data.py +192 -0
- upstox-python-sdk-2.0.0/upstox_client/models/profit_and_loss_charges_taxes.py +168 -0
- upstox-python-sdk-2.0.0/upstox_client/models/profit_and_loss_charges_wrapper_data.py +110 -0
- upstox-python-sdk-2.0.0/upstox_client/models/profit_and_loss_meta_data.py +140 -0
- upstox-python-sdk-2.0.0/upstox_client/models/profit_and_loss_meta_data_wrapper.py +110 -0
- upstox-python-sdk-2.0.0/upstox_client/models/profit_and_loss_other_charges_taxes.py +224 -0
- upstox-python-sdk-2.0.0/upstox_client/models/token_request.py +227 -0
- upstox-python-sdk-2.0.0/upstox_client/models/token_response.py +413 -0
- upstox-python-sdk-2.0.0/upstox_client/models/trade_data.py +500 -0
- upstox-python-sdk-2.0.0/upstox_client/models/trade_wise_meta_data.py +140 -0
- upstox-python-sdk-2.0.0/upstox_client/models/trade_wise_profit_and_loss_data.py +364 -0
- upstox-python-sdk-2.0.0/upstox_client/models/user_fund_margin_data.py +280 -0
- upstox-python-sdk-2.0.0/upstox_client/models/websocket_auth_redirect_response.py +142 -0
- upstox-python-sdk-2.0.0/upstox_client/models/websocket_auth_redirect_response_data.py +110 -0
- upstox-python-sdk-2.0.0/upstox_client/rest.py +317 -0
- upstox-python-sdk-2.0.0/upstox_python_sdk.egg-info/PKG-INFO +197 -0
- upstox-python-sdk-2.0.0/upstox_python_sdk.egg-info/SOURCES.txt +167 -0
- upstox-python-sdk-2.0.0/upstox_python_sdk.egg-info/dependency_links.txt +1 -0
- upstox-python-sdk-2.0.0/upstox_python_sdk.egg-info/requires.txt +4 -0
- upstox-python-sdk-2.0.0/upstox_python_sdk.egg-info/top_level.txt +2 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2023 Upstox
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: upstox-python-sdk
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Upstox Developer API
|
|
5
|
+
Home-page: https://github.com/upstox/upstox-python
|
|
6
|
+
License: MIT
|
|
7
|
+
Description: # Upstox Python SDK for API v2
|
|
8
|
+
|
|
9
|
+
## Introduction
|
|
10
|
+
|
|
11
|
+
The official Python client for communicating with the <a href="https://upstox.com/uplink/">Upstox API</a>.
|
|
12
|
+
|
|
13
|
+
Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection.
|
|
14
|
+
|
|
15
|
+
- API version: v2
|
|
16
|
+
- Package version: 2.0.0
|
|
17
|
+
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
|
|
18
|
+
|
|
19
|
+
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.
|
|
20
|
+
|
|
21
|
+
## Documentation.
|
|
22
|
+
|
|
23
|
+
<a href="https://upstox.com/developer/api-documentation">Upstox API Documentation</a>
|
|
24
|
+
|
|
25
|
+
## Requirements.
|
|
26
|
+
|
|
27
|
+
Python 2.7 and 3.4+
|
|
28
|
+
|
|
29
|
+
## Installation & Usage
|
|
30
|
+
### pip install
|
|
31
|
+
|
|
32
|
+
If the python package is hosted on Github, you can install directly from Github
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
pip install upstox-python-sdk
|
|
36
|
+
```
|
|
37
|
+
(you may need to run `pip` with root permission: `sudo pip install upstox-python-sdk`)
|
|
38
|
+
|
|
39
|
+
Then import the package:
|
|
40
|
+
```python
|
|
41
|
+
import upstox_client
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Setuptools
|
|
45
|
+
|
|
46
|
+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
python setup.py install --user
|
|
50
|
+
```
|
|
51
|
+
(or `sudo python setup.py install` to install the package for all users)
|
|
52
|
+
|
|
53
|
+
Then import the package:
|
|
54
|
+
```python
|
|
55
|
+
import upstox_client
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Getting Started
|
|
59
|
+
|
|
60
|
+
Please follow the [installation procedure](#installation--usage) and then run the following:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from __future__ import print_function
|
|
64
|
+
import time
|
|
65
|
+
import upstox_client
|
|
66
|
+
from upstox_client.rest import ApiException
|
|
67
|
+
from pprint import pprint
|
|
68
|
+
|
|
69
|
+
# Configure OAuth2 access token for authorization: OAUTH2
|
|
70
|
+
configuration = upstox_client.Configuration()
|
|
71
|
+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
|
72
|
+
|
|
73
|
+
# create an instance of the API class
|
|
74
|
+
api_instance = upstox_client.ChargeApi(upstox_client.ApiClient(configuration))
|
|
75
|
+
instrument_token = 'instrument_token_example' # str | Key of the instrument
|
|
76
|
+
quantity = 56 # int | Quantity with which the order is to be placed
|
|
77
|
+
product = 'product_example' # str | Product with which the order is to be placed
|
|
78
|
+
transaction_type = 'transaction_type_example' # str | Indicates whether its a BUY or SELL order
|
|
79
|
+
price = 3.4 # float | Price with which the order is to be placed
|
|
80
|
+
api_version = 'api_version_example' # str | API Version Header
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
# Brokerage details
|
|
84
|
+
api_response = api_instance.get_brokerage(instrument_token, quantity, product, transaction_type, price, api_version)
|
|
85
|
+
pprint(api_response)
|
|
86
|
+
except ApiException as e:
|
|
87
|
+
print("Exception when calling ChargeApi->get_brokerage: %s\n" % e)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Documentation for API Endpoints
|
|
91
|
+
|
|
92
|
+
All URIs are relative to *https://api-v2.upstox.com*
|
|
93
|
+
|
|
94
|
+
Class | Method | HTTP request | Description
|
|
95
|
+
------------ | ------------- | ------------- | -------------
|
|
96
|
+
*ChargeApi* | [**get_brokerage**](docs/ChargeApi.md#get_brokerage) | **GET** /charges/brokerage | Brokerage details
|
|
97
|
+
*HistoryApi* | [**get_historical_candle_data**](docs/HistoryApi.md#get_historical_candle_data) | **GET** /historical-candle/{instrumentKey}/{interval}/{to_date} | Historical candle data
|
|
98
|
+
*HistoryApi* | [**get_historical_candle_data1**](docs/HistoryApi.md#get_historical_candle_data1) | **GET** /historical-candle/{instrumentKey}/{interval}/{to_date}/{from_date} | Historical candle data
|
|
99
|
+
*HistoryApi* | [**get_intra_day_candle_data**](docs/HistoryApi.md#get_intra_day_candle_data) | **GET** /historical-candle/intraday/{instrumentKey}/{interval} | Intra day candle data
|
|
100
|
+
*LoginApi* | [**authorize**](docs/LoginApi.md#authorize) | **GET** /login/authorization/dialog | Authorize API
|
|
101
|
+
*LoginApi* | [**logout**](docs/LoginApi.md#logout) | **DELETE** /logout | Logout
|
|
102
|
+
*LoginApi* | [**token**](docs/LoginApi.md#token) | **POST** /login/authorization/token | Get token API
|
|
103
|
+
*MarketQuoteApi* | [**get_full_market_quote**](docs/MarketQuoteApi.md#get_full_market_quote) | **GET** /market-quote/quotes | Market quotes and instruments - Full market quotes
|
|
104
|
+
*MarketQuoteApi* | [**get_market_quote_ohlc**](docs/MarketQuoteApi.md#get_market_quote_ohlc) | **GET** /market-quote/ohlc | Market quotes and instruments - OHLC quotes
|
|
105
|
+
*MarketQuoteApi* | [**ltp**](docs/MarketQuoteApi.md#ltp) | **GET** /market-quote/ltp | Market quotes and instruments - LTP quotes.
|
|
106
|
+
*OrderApi* | [**cancel_order**](docs/OrderApi.md#cancel_order) | **DELETE** /order/cancel | Cancel order
|
|
107
|
+
*OrderApi* | [**get_order_book**](docs/OrderApi.md#get_order_book) | **GET** /order/retrieve-all | Get order book
|
|
108
|
+
*OrderApi* | [**get_order_details**](docs/OrderApi.md#get_order_details) | **GET** /order/history | Get order details
|
|
109
|
+
*OrderApi* | [**get_trade_history**](docs/OrderApi.md#get_trade_history) | **GET** /order/trades/get-trades-for-day | Get trades
|
|
110
|
+
*OrderApi* | [**get_trades_by_order**](docs/OrderApi.md#get_trades_by_order) | **GET** /order/trades | Get trades for order
|
|
111
|
+
*OrderApi* | [**modify_order**](docs/OrderApi.md#modify_order) | **PUT** /order/modify | Modify order
|
|
112
|
+
*OrderApi* | [**place_order**](docs/OrderApi.md#place_order) | **POST** /order/place | Place order
|
|
113
|
+
*PortfolioApi* | [**convert_positions**](docs/PortfolioApi.md#convert_positions) | **PUT** /portfolio/convert-position | Convert Positions
|
|
114
|
+
*PortfolioApi* | [**get_holdings**](docs/PortfolioApi.md#get_holdings) | **GET** /portfolio/long-term-holdings | Get Holdings
|
|
115
|
+
*PortfolioApi* | [**get_positions**](docs/PortfolioApi.md#get_positions) | **GET** /portfolio/short-term-positions | Get Positions
|
|
116
|
+
*TradeProfitAndLossApi* | [**get_profit_and_loss_charges**](docs/TradeProfitAndLossApi.md#get_profit_and_loss_charges) | **GET** /trade/profit-loss/charges | Get profit and loss on trades
|
|
117
|
+
*TradeProfitAndLossApi* | [**get_trade_wise_profit_and_loss_data**](docs/TradeProfitAndLossApi.md#get_trade_wise_profit_and_loss_data) | **GET** /trade/profit-loss/data | Get Trade-wise Profit and Loss Report Data
|
|
118
|
+
*TradeProfitAndLossApi* | [**get_trade_wise_profit_and_loss_meta_data**](docs/TradeProfitAndLossApi.md#get_trade_wise_profit_and_loss_meta_data) | **GET** /trade/profit-loss/metadata | Get profit and loss meta data on trades
|
|
119
|
+
*UserApi* | [**get_profile**](docs/UserApi.md#get_profile) | **GET** /user/profile | Get profile
|
|
120
|
+
*UserApi* | [**get_user_fund_margin**](docs/UserApi.md#get_user_fund_margin) | **GET** /user/get-funds-and-margin | Get User Fund And Margin
|
|
121
|
+
*WebsocketApi* | [**get_market_data_feed**](docs/WebsocketApi.md#get_market_data_feed) | **GET** /feed/market-data-feed | Market Data Feed
|
|
122
|
+
*WebsocketApi* | [**get_market_data_feed_authorize**](docs/WebsocketApi.md#get_market_data_feed_authorize) | **GET** /feed/market-data-feed/authorize | Market Data Feed Authorize
|
|
123
|
+
*WebsocketApi* | [**get_portfolio_stream_feed**](docs/WebsocketApi.md#get_portfolio_stream_feed) | **GET** /feed/portfolio-stream-feed | Portfolio Stream Feed
|
|
124
|
+
*WebsocketApi* | [**get_portfolio_stream_feed_authorize**](docs/WebsocketApi.md#get_portfolio_stream_feed_authorize) | **GET** /feed/portfolio-stream-feed/authorize | Portfolio Stream Feed Authorize
|
|
125
|
+
|
|
126
|
+
## Documentation For Models
|
|
127
|
+
|
|
128
|
+
- [ApiGatewayErrorResponse](docs/ApiGatewayErrorResponse.md)
|
|
129
|
+
- [BrokerageData](docs/BrokerageData.md)
|
|
130
|
+
- [BrokerageTaxes](docs/BrokerageTaxes.md)
|
|
131
|
+
- [BrokerageWrapperData](docs/BrokerageWrapperData.md)
|
|
132
|
+
- [CancelOrderData](docs/CancelOrderData.md)
|
|
133
|
+
- [CancelOrderResponse](docs/CancelOrderResponse.md)
|
|
134
|
+
- [ConvertPositionData](docs/ConvertPositionData.md)
|
|
135
|
+
- [ConvertPositionRequest](docs/ConvertPositionRequest.md)
|
|
136
|
+
- [ConvertPositionResponse](docs/ConvertPositionResponse.md)
|
|
137
|
+
- [Depth](docs/Depth.md)
|
|
138
|
+
- [DepthMap](docs/DepthMap.md)
|
|
139
|
+
- [DpPlan](docs/DpPlan.md)
|
|
140
|
+
- [GetBrokerageResponse](docs/GetBrokerageResponse.md)
|
|
141
|
+
- [GetFullMarketQuoteResponse](docs/GetFullMarketQuoteResponse.md)
|
|
142
|
+
- [GetHistoricalCandleResponse](docs/GetHistoricalCandleResponse.md)
|
|
143
|
+
- [GetHoldingsResponse](docs/GetHoldingsResponse.md)
|
|
144
|
+
- [GetIntraDayCandleResponse](docs/GetIntraDayCandleResponse.md)
|
|
145
|
+
- [GetMarketQuoteLastTradedPriceResponse](docs/GetMarketQuoteLastTradedPriceResponse.md)
|
|
146
|
+
- [GetMarketQuoteOHLCResponse](docs/GetMarketQuoteOHLCResponse.md)
|
|
147
|
+
- [GetOrderBookResponse](docs/GetOrderBookResponse.md)
|
|
148
|
+
- [GetOrderResponse](docs/GetOrderResponse.md)
|
|
149
|
+
- [GetPositionResponse](docs/GetPositionResponse.md)
|
|
150
|
+
- [GetProfileResponse](docs/GetProfileResponse.md)
|
|
151
|
+
- [GetProfitAndLossChargesResponse](docs/GetProfitAndLossChargesResponse.md)
|
|
152
|
+
- [GetTradeResponse](docs/GetTradeResponse.md)
|
|
153
|
+
- [GetTradeWiseProfitAndLossDataResponse](docs/GetTradeWiseProfitAndLossDataResponse.md)
|
|
154
|
+
- [GetTradeWiseProfitAndLossMetaDataResponse](docs/GetTradeWiseProfitAndLossMetaDataResponse.md)
|
|
155
|
+
- [GetUserFundMarginResponse](docs/GetUserFundMarginResponse.md)
|
|
156
|
+
- [HistoricalCandleData](docs/HistoricalCandleData.md)
|
|
157
|
+
- [HoldingsData](docs/HoldingsData.md)
|
|
158
|
+
- [IntraDayCandleData](docs/IntraDayCandleData.md)
|
|
159
|
+
- [LogoutResponse](docs/LogoutResponse.md)
|
|
160
|
+
- [MarketQuoteOHLC](docs/MarketQuoteOHLC.md)
|
|
161
|
+
- [MarketQuoteSymbol](docs/MarketQuoteSymbol.md)
|
|
162
|
+
- [MarketQuoteSymbolLtp](docs/MarketQuoteSymbolLtp.md)
|
|
163
|
+
- [ModifyOrderData](docs/ModifyOrderData.md)
|
|
164
|
+
- [ModifyOrderRequest](docs/ModifyOrderRequest.md)
|
|
165
|
+
- [ModifyOrderResponse](docs/ModifyOrderResponse.md)
|
|
166
|
+
- [OAuthClientException](docs/OAuthClientException.md)
|
|
167
|
+
- [OAuthClientExceptionCause](docs/OAuthClientExceptionCause.md)
|
|
168
|
+
- [OAuthClientExceptionCauseStackTrace](docs/OAuthClientExceptionCauseStackTrace.md)
|
|
169
|
+
- [OAuthClientExceptionCauseSuppressed](docs/OAuthClientExceptionCauseSuppressed.md)
|
|
170
|
+
- [Ohlc](docs/Ohlc.md)
|
|
171
|
+
- [OrderBookData](docs/OrderBookData.md)
|
|
172
|
+
- [OrderData](docs/OrderData.md)
|
|
173
|
+
- [OtherTaxes](docs/OtherTaxes.md)
|
|
174
|
+
- [PlaceOrderData](docs/PlaceOrderData.md)
|
|
175
|
+
- [PlaceOrderRequest](docs/PlaceOrderRequest.md)
|
|
176
|
+
- [PlaceOrderResponse](docs/PlaceOrderResponse.md)
|
|
177
|
+
- [PositionData](docs/PositionData.md)
|
|
178
|
+
- [Problem](docs/Problem.md)
|
|
179
|
+
- [ProfileData](docs/ProfileData.md)
|
|
180
|
+
- [ProfitAndLossChargesData](docs/ProfitAndLossChargesData.md)
|
|
181
|
+
- [ProfitAndLossChargesTaxes](docs/ProfitAndLossChargesTaxes.md)
|
|
182
|
+
- [ProfitAndLossChargesWrapperData](docs/ProfitAndLossChargesWrapperData.md)
|
|
183
|
+
- [ProfitAndLossMetaData](docs/ProfitAndLossMetaData.md)
|
|
184
|
+
- [ProfitAndLossMetaDataWrapper](docs/ProfitAndLossMetaDataWrapper.md)
|
|
185
|
+
- [ProfitAndLossOtherChargesTaxes](docs/ProfitAndLossOtherChargesTaxes.md)
|
|
186
|
+
- [TokenRequest](docs/TokenRequest.md)
|
|
187
|
+
- [TokenResponse](docs/TokenResponse.md)
|
|
188
|
+
- [TradeData](docs/TradeData.md)
|
|
189
|
+
- [TradeWiseMetaData](docs/TradeWiseMetaData.md)
|
|
190
|
+
- [TradeWiseProfitAndLossData](docs/TradeWiseProfitAndLossData.md)
|
|
191
|
+
- [UserFundMarginData](docs/UserFundMarginData.md)
|
|
192
|
+
- [WebsocketAuthRedirectResponse](docs/WebsocketAuthRedirectResponse.md)
|
|
193
|
+
- [WebsocketAuthRedirectResponseData](docs/WebsocketAuthRedirectResponseData.md)
|
|
194
|
+
|
|
195
|
+
Keywords: Upstox Developer API
|
|
196
|
+
Platform: UNKNOWN
|
|
197
|
+
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Upstox Python SDK for API v2
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
The official Python client for communicating with the <a href="https://upstox.com/uplink/">Upstox API</a>.
|
|
6
|
+
|
|
7
|
+
Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection.
|
|
8
|
+
|
|
9
|
+
- API version: v2
|
|
10
|
+
- Package version: 2.0.0
|
|
11
|
+
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
|
|
12
|
+
|
|
13
|
+
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.
|
|
14
|
+
|
|
15
|
+
## Documentation.
|
|
16
|
+
|
|
17
|
+
<a href="https://upstox.com/developer/api-documentation">Upstox API Documentation</a>
|
|
18
|
+
|
|
19
|
+
## Requirements.
|
|
20
|
+
|
|
21
|
+
Python 2.7 and 3.4+
|
|
22
|
+
|
|
23
|
+
## Installation & Usage
|
|
24
|
+
### pip install
|
|
25
|
+
|
|
26
|
+
If the python package is hosted on Github, you can install directly from Github
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pip install upstox-python-sdk
|
|
30
|
+
```
|
|
31
|
+
(you may need to run `pip` with root permission: `sudo pip install upstox-python-sdk`)
|
|
32
|
+
|
|
33
|
+
Then import the package:
|
|
34
|
+
```python
|
|
35
|
+
import upstox_client
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Setuptools
|
|
39
|
+
|
|
40
|
+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
python setup.py install --user
|
|
44
|
+
```
|
|
45
|
+
(or `sudo python setup.py install` to install the package for all users)
|
|
46
|
+
|
|
47
|
+
Then import the package:
|
|
48
|
+
```python
|
|
49
|
+
import upstox_client
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Getting Started
|
|
53
|
+
|
|
54
|
+
Please follow the [installation procedure](#installation--usage) and then run the following:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from __future__ import print_function
|
|
58
|
+
import time
|
|
59
|
+
import upstox_client
|
|
60
|
+
from upstox_client.rest import ApiException
|
|
61
|
+
from pprint import pprint
|
|
62
|
+
|
|
63
|
+
# Configure OAuth2 access token for authorization: OAUTH2
|
|
64
|
+
configuration = upstox_client.Configuration()
|
|
65
|
+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
|
66
|
+
|
|
67
|
+
# create an instance of the API class
|
|
68
|
+
api_instance = upstox_client.ChargeApi(upstox_client.ApiClient(configuration))
|
|
69
|
+
instrument_token = 'instrument_token_example' # str | Key of the instrument
|
|
70
|
+
quantity = 56 # int | Quantity with which the order is to be placed
|
|
71
|
+
product = 'product_example' # str | Product with which the order is to be placed
|
|
72
|
+
transaction_type = 'transaction_type_example' # str | Indicates whether its a BUY or SELL order
|
|
73
|
+
price = 3.4 # float | Price with which the order is to be placed
|
|
74
|
+
api_version = 'api_version_example' # str | API Version Header
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
# Brokerage details
|
|
78
|
+
api_response = api_instance.get_brokerage(instrument_token, quantity, product, transaction_type, price, api_version)
|
|
79
|
+
pprint(api_response)
|
|
80
|
+
except ApiException as e:
|
|
81
|
+
print("Exception when calling ChargeApi->get_brokerage: %s\n" % e)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Documentation for API Endpoints
|
|
85
|
+
|
|
86
|
+
All URIs are relative to *https://api-v2.upstox.com*
|
|
87
|
+
|
|
88
|
+
Class | Method | HTTP request | Description
|
|
89
|
+
------------ | ------------- | ------------- | -------------
|
|
90
|
+
*ChargeApi* | [**get_brokerage**](docs/ChargeApi.md#get_brokerage) | **GET** /charges/brokerage | Brokerage details
|
|
91
|
+
*HistoryApi* | [**get_historical_candle_data**](docs/HistoryApi.md#get_historical_candle_data) | **GET** /historical-candle/{instrumentKey}/{interval}/{to_date} | Historical candle data
|
|
92
|
+
*HistoryApi* | [**get_historical_candle_data1**](docs/HistoryApi.md#get_historical_candle_data1) | **GET** /historical-candle/{instrumentKey}/{interval}/{to_date}/{from_date} | Historical candle data
|
|
93
|
+
*HistoryApi* | [**get_intra_day_candle_data**](docs/HistoryApi.md#get_intra_day_candle_data) | **GET** /historical-candle/intraday/{instrumentKey}/{interval} | Intra day candle data
|
|
94
|
+
*LoginApi* | [**authorize**](docs/LoginApi.md#authorize) | **GET** /login/authorization/dialog | Authorize API
|
|
95
|
+
*LoginApi* | [**logout**](docs/LoginApi.md#logout) | **DELETE** /logout | Logout
|
|
96
|
+
*LoginApi* | [**token**](docs/LoginApi.md#token) | **POST** /login/authorization/token | Get token API
|
|
97
|
+
*MarketQuoteApi* | [**get_full_market_quote**](docs/MarketQuoteApi.md#get_full_market_quote) | **GET** /market-quote/quotes | Market quotes and instruments - Full market quotes
|
|
98
|
+
*MarketQuoteApi* | [**get_market_quote_ohlc**](docs/MarketQuoteApi.md#get_market_quote_ohlc) | **GET** /market-quote/ohlc | Market quotes and instruments - OHLC quotes
|
|
99
|
+
*MarketQuoteApi* | [**ltp**](docs/MarketQuoteApi.md#ltp) | **GET** /market-quote/ltp | Market quotes and instruments - LTP quotes.
|
|
100
|
+
*OrderApi* | [**cancel_order**](docs/OrderApi.md#cancel_order) | **DELETE** /order/cancel | Cancel order
|
|
101
|
+
*OrderApi* | [**get_order_book**](docs/OrderApi.md#get_order_book) | **GET** /order/retrieve-all | Get order book
|
|
102
|
+
*OrderApi* | [**get_order_details**](docs/OrderApi.md#get_order_details) | **GET** /order/history | Get order details
|
|
103
|
+
*OrderApi* | [**get_trade_history**](docs/OrderApi.md#get_trade_history) | **GET** /order/trades/get-trades-for-day | Get trades
|
|
104
|
+
*OrderApi* | [**get_trades_by_order**](docs/OrderApi.md#get_trades_by_order) | **GET** /order/trades | Get trades for order
|
|
105
|
+
*OrderApi* | [**modify_order**](docs/OrderApi.md#modify_order) | **PUT** /order/modify | Modify order
|
|
106
|
+
*OrderApi* | [**place_order**](docs/OrderApi.md#place_order) | **POST** /order/place | Place order
|
|
107
|
+
*PortfolioApi* | [**convert_positions**](docs/PortfolioApi.md#convert_positions) | **PUT** /portfolio/convert-position | Convert Positions
|
|
108
|
+
*PortfolioApi* | [**get_holdings**](docs/PortfolioApi.md#get_holdings) | **GET** /portfolio/long-term-holdings | Get Holdings
|
|
109
|
+
*PortfolioApi* | [**get_positions**](docs/PortfolioApi.md#get_positions) | **GET** /portfolio/short-term-positions | Get Positions
|
|
110
|
+
*TradeProfitAndLossApi* | [**get_profit_and_loss_charges**](docs/TradeProfitAndLossApi.md#get_profit_and_loss_charges) | **GET** /trade/profit-loss/charges | Get profit and loss on trades
|
|
111
|
+
*TradeProfitAndLossApi* | [**get_trade_wise_profit_and_loss_data**](docs/TradeProfitAndLossApi.md#get_trade_wise_profit_and_loss_data) | **GET** /trade/profit-loss/data | Get Trade-wise Profit and Loss Report Data
|
|
112
|
+
*TradeProfitAndLossApi* | [**get_trade_wise_profit_and_loss_meta_data**](docs/TradeProfitAndLossApi.md#get_trade_wise_profit_and_loss_meta_data) | **GET** /trade/profit-loss/metadata | Get profit and loss meta data on trades
|
|
113
|
+
*UserApi* | [**get_profile**](docs/UserApi.md#get_profile) | **GET** /user/profile | Get profile
|
|
114
|
+
*UserApi* | [**get_user_fund_margin**](docs/UserApi.md#get_user_fund_margin) | **GET** /user/get-funds-and-margin | Get User Fund And Margin
|
|
115
|
+
*WebsocketApi* | [**get_market_data_feed**](docs/WebsocketApi.md#get_market_data_feed) | **GET** /feed/market-data-feed | Market Data Feed
|
|
116
|
+
*WebsocketApi* | [**get_market_data_feed_authorize**](docs/WebsocketApi.md#get_market_data_feed_authorize) | **GET** /feed/market-data-feed/authorize | Market Data Feed Authorize
|
|
117
|
+
*WebsocketApi* | [**get_portfolio_stream_feed**](docs/WebsocketApi.md#get_portfolio_stream_feed) | **GET** /feed/portfolio-stream-feed | Portfolio Stream Feed
|
|
118
|
+
*WebsocketApi* | [**get_portfolio_stream_feed_authorize**](docs/WebsocketApi.md#get_portfolio_stream_feed_authorize) | **GET** /feed/portfolio-stream-feed/authorize | Portfolio Stream Feed Authorize
|
|
119
|
+
|
|
120
|
+
## Documentation For Models
|
|
121
|
+
|
|
122
|
+
- [ApiGatewayErrorResponse](docs/ApiGatewayErrorResponse.md)
|
|
123
|
+
- [BrokerageData](docs/BrokerageData.md)
|
|
124
|
+
- [BrokerageTaxes](docs/BrokerageTaxes.md)
|
|
125
|
+
- [BrokerageWrapperData](docs/BrokerageWrapperData.md)
|
|
126
|
+
- [CancelOrderData](docs/CancelOrderData.md)
|
|
127
|
+
- [CancelOrderResponse](docs/CancelOrderResponse.md)
|
|
128
|
+
- [ConvertPositionData](docs/ConvertPositionData.md)
|
|
129
|
+
- [ConvertPositionRequest](docs/ConvertPositionRequest.md)
|
|
130
|
+
- [ConvertPositionResponse](docs/ConvertPositionResponse.md)
|
|
131
|
+
- [Depth](docs/Depth.md)
|
|
132
|
+
- [DepthMap](docs/DepthMap.md)
|
|
133
|
+
- [DpPlan](docs/DpPlan.md)
|
|
134
|
+
- [GetBrokerageResponse](docs/GetBrokerageResponse.md)
|
|
135
|
+
- [GetFullMarketQuoteResponse](docs/GetFullMarketQuoteResponse.md)
|
|
136
|
+
- [GetHistoricalCandleResponse](docs/GetHistoricalCandleResponse.md)
|
|
137
|
+
- [GetHoldingsResponse](docs/GetHoldingsResponse.md)
|
|
138
|
+
- [GetIntraDayCandleResponse](docs/GetIntraDayCandleResponse.md)
|
|
139
|
+
- [GetMarketQuoteLastTradedPriceResponse](docs/GetMarketQuoteLastTradedPriceResponse.md)
|
|
140
|
+
- [GetMarketQuoteOHLCResponse](docs/GetMarketQuoteOHLCResponse.md)
|
|
141
|
+
- [GetOrderBookResponse](docs/GetOrderBookResponse.md)
|
|
142
|
+
- [GetOrderResponse](docs/GetOrderResponse.md)
|
|
143
|
+
- [GetPositionResponse](docs/GetPositionResponse.md)
|
|
144
|
+
- [GetProfileResponse](docs/GetProfileResponse.md)
|
|
145
|
+
- [GetProfitAndLossChargesResponse](docs/GetProfitAndLossChargesResponse.md)
|
|
146
|
+
- [GetTradeResponse](docs/GetTradeResponse.md)
|
|
147
|
+
- [GetTradeWiseProfitAndLossDataResponse](docs/GetTradeWiseProfitAndLossDataResponse.md)
|
|
148
|
+
- [GetTradeWiseProfitAndLossMetaDataResponse](docs/GetTradeWiseProfitAndLossMetaDataResponse.md)
|
|
149
|
+
- [GetUserFundMarginResponse](docs/GetUserFundMarginResponse.md)
|
|
150
|
+
- [HistoricalCandleData](docs/HistoricalCandleData.md)
|
|
151
|
+
- [HoldingsData](docs/HoldingsData.md)
|
|
152
|
+
- [IntraDayCandleData](docs/IntraDayCandleData.md)
|
|
153
|
+
- [LogoutResponse](docs/LogoutResponse.md)
|
|
154
|
+
- [MarketQuoteOHLC](docs/MarketQuoteOHLC.md)
|
|
155
|
+
- [MarketQuoteSymbol](docs/MarketQuoteSymbol.md)
|
|
156
|
+
- [MarketQuoteSymbolLtp](docs/MarketQuoteSymbolLtp.md)
|
|
157
|
+
- [ModifyOrderData](docs/ModifyOrderData.md)
|
|
158
|
+
- [ModifyOrderRequest](docs/ModifyOrderRequest.md)
|
|
159
|
+
- [ModifyOrderResponse](docs/ModifyOrderResponse.md)
|
|
160
|
+
- [OAuthClientException](docs/OAuthClientException.md)
|
|
161
|
+
- [OAuthClientExceptionCause](docs/OAuthClientExceptionCause.md)
|
|
162
|
+
- [OAuthClientExceptionCauseStackTrace](docs/OAuthClientExceptionCauseStackTrace.md)
|
|
163
|
+
- [OAuthClientExceptionCauseSuppressed](docs/OAuthClientExceptionCauseSuppressed.md)
|
|
164
|
+
- [Ohlc](docs/Ohlc.md)
|
|
165
|
+
- [OrderBookData](docs/OrderBookData.md)
|
|
166
|
+
- [OrderData](docs/OrderData.md)
|
|
167
|
+
- [OtherTaxes](docs/OtherTaxes.md)
|
|
168
|
+
- [PlaceOrderData](docs/PlaceOrderData.md)
|
|
169
|
+
- [PlaceOrderRequest](docs/PlaceOrderRequest.md)
|
|
170
|
+
- [PlaceOrderResponse](docs/PlaceOrderResponse.md)
|
|
171
|
+
- [PositionData](docs/PositionData.md)
|
|
172
|
+
- [Problem](docs/Problem.md)
|
|
173
|
+
- [ProfileData](docs/ProfileData.md)
|
|
174
|
+
- [ProfitAndLossChargesData](docs/ProfitAndLossChargesData.md)
|
|
175
|
+
- [ProfitAndLossChargesTaxes](docs/ProfitAndLossChargesTaxes.md)
|
|
176
|
+
- [ProfitAndLossChargesWrapperData](docs/ProfitAndLossChargesWrapperData.md)
|
|
177
|
+
- [ProfitAndLossMetaData](docs/ProfitAndLossMetaData.md)
|
|
178
|
+
- [ProfitAndLossMetaDataWrapper](docs/ProfitAndLossMetaDataWrapper.md)
|
|
179
|
+
- [ProfitAndLossOtherChargesTaxes](docs/ProfitAndLossOtherChargesTaxes.md)
|
|
180
|
+
- [TokenRequest](docs/TokenRequest.md)
|
|
181
|
+
- [TokenResponse](docs/TokenResponse.md)
|
|
182
|
+
- [TradeData](docs/TradeData.md)
|
|
183
|
+
- [TradeWiseMetaData](docs/TradeWiseMetaData.md)
|
|
184
|
+
- [TradeWiseProfitAndLossData](docs/TradeWiseProfitAndLossData.md)
|
|
185
|
+
- [UserFundMarginData](docs/UserFundMarginData.md)
|
|
186
|
+
- [WebsocketAuthRedirectResponse](docs/WebsocketAuthRedirectResponse.md)
|
|
187
|
+
- [WebsocketAuthRedirectResponseData](docs/WebsocketAuthRedirectResponseData.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Upstox Developer API
|
|
5
|
+
|
|
6
|
+
Build your App on the Upstox platform  # Introduction Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection. All requests are over HTTPS and the requests are sent with the content-type ‘application/json’. Developers have the option of choosing the response type as JSON or CSV for a few API calls. To be able to use these APIs you need to create an App in the Developer Console and generate your **apiKey** and **apiSecret**. You can use a redirect URL which will be called after the login flow. If you are a **trader**, you can directly create apps from Upstox mobile app or the desktop platform itself from **Apps** sections inside the **Account** Tab. Head over to <a href=\"http://account.upstox.com/developer/apps\" target=\"_blank\">account.upstox.com/developer/apps</a>.</br> If you are a **business** looking to integrate Upstox APIs, reach out to us and we will get a custom app created for you in no time. It is highly recommended that you do not embed the **apiSecret** in your frontend app. Create a remote backend which does the handshake on behalf of the frontend app. Marking the apiSecret in the frontend app will make your app vulnerable to threats and potential issues. # noqa: E501
|
|
7
|
+
|
|
8
|
+
OpenAPI spec version: v2
|
|
9
|
+
|
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from setuptools import setup, find_packages # noqa: H301
|
|
14
|
+
|
|
15
|
+
# read the contents of your README file
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
this_directory = Path(__file__).parent
|
|
18
|
+
long_description = (this_directory / "README.md").read_text()
|
|
19
|
+
|
|
20
|
+
NAME = "upstox-python-sdk"
|
|
21
|
+
VERSION = "2.0.0"
|
|
22
|
+
# To install the library, run the following
|
|
23
|
+
#
|
|
24
|
+
# python setup.py install
|
|
25
|
+
#
|
|
26
|
+
# prerequisite: setuptools
|
|
27
|
+
# http://pypi.python.org/pypi/setuptools
|
|
28
|
+
|
|
29
|
+
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
|
|
30
|
+
|
|
31
|
+
setup(
|
|
32
|
+
name=NAME,
|
|
33
|
+
version=VERSION,
|
|
34
|
+
license='MIT',
|
|
35
|
+
description="Upstox Developer API",
|
|
36
|
+
url="https://github.com/upstox/upstox-python",
|
|
37
|
+
keywords=["Upstox Developer API"],
|
|
38
|
+
install_requires=REQUIRES,
|
|
39
|
+
packages=find_packages(),
|
|
40
|
+
include_package_data=True,
|
|
41
|
+
long_description=long_description,
|
|
42
|
+
long_description_content_type='text/markdown'
|
|
43
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# coding: utf-8
|