Skip to content

Commit f7fc193

Browse files
authored
Merge pull request #45 from upstox/feature/reorganizing-as-upstox-client
feat: re-org to upstox_client
2 parents 0e5ef8e + bc371ec commit f7fc193

File tree

173 files changed

+712
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+712
-711
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ target/
6666
#Ignore swagger generated files
6767
.swagger-codegen/
6868
.vscode/
69-
swagger-codegen-ignore
69+
.swagger-codegen-ignore
7070
git_push.sh

LICENSE.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Python 2.7 and 3.4+
2626
If the python package is hosted on Github, you can install directly from Github
2727

2828
```sh
29-
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
29+
pip install upstox-python
3030
```
31-
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
31+
(you may need to run `pip` with root permission: `sudo pip install upstox-python`)
3232

3333
Then import the package:
3434
```python
35-
import swagger_client
35+
import upstox_client
3636
```
3737

3838
### Setuptools
@@ -46,13 +46,7 @@ python setup.py install --user
4646

4747
Then import the package:
4848
```python
49-
import swagger_client
50-
```
51-
52-
### Test utility
53-
Test utility file can be found at
54-
```
55-
./test/sanity_test.py
49+
import upstox_client
5650
```
5751

5852
## Getting Started
@@ -62,16 +56,16 @@ Please follow the [installation procedure](#installation--usage) and then run th
6256
```python
6357
from __future__ import print_function
6458
import time
65-
import swagger_client
66-
from swagger_client.rest import ApiException
59+
import upstox_client
60+
from upstox_client.rest import ApiException
6761
from pprint import pprint
6862

6963
# Configure OAuth2 access token for authorization: OAUTH2
70-
configuration = swagger_client.Configuration()
64+
configuration = upstox_client.Configuration()
7165
configuration.access_token = 'YOUR_ACCESS_TOKEN'
7266

7367
# create an instance of the API class
74-
api_instance = swagger_client.ChargeApi(swagger_client.ApiClient(configuration))
68+
api_instance = upstox_client.ChargeApi(upstox_client.ApiClient(configuration))
7569
instrument_token = 'instrument_token_example' # str | Key of the instrument
7670
quantity = 56 # int | Quantity with which the order is to be placed
7771
product = 'product_example' # str | Product with which the order is to be placed

docs/ChargeApi.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# swagger_client.ChargeApi
1+
# upstox_client.ChargeApi
22

33
All URIs are relative to *https://api-v2.upstox.com*
44

@@ -17,16 +17,16 @@ Compute Brokerage Charges
1717
```python
1818
from __future__ import print_function
1919
import time
20-
import swagger_client
21-
from swagger_client.rest import ApiException
20+
import upstox_client
21+
from upstox_client.rest import ApiException
2222
from pprint import pprint
2323

2424
# Configure OAuth2 access token for authorization: OAUTH2
25-
configuration = swagger_client.Configuration()
25+
configuration = upstox_client.Configuration()
2626
configuration.access_token = 'YOUR_ACCESS_TOKEN'
2727

2828
# create an instance of the API class
29-
api_instance = swagger_client.ChargeApi(swagger_client.ApiClient(configuration))
29+
api_instance = upstox_client.ChargeApi(upstox_client.ApiClient(configuration))
3030
instrument_token = 'instrument_token_example' # str | Key of the instrument
3131
quantity = 56 # int | Quantity with which the order is to be placed
3232
product = 'product_example' # str | Product with which the order is to be placed

docs/HistoryApi.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# swagger_client.HistoryApi
1+
# upstox_client.HistoryApi
22

33
All URIs are relative to *https://api-v2.upstox.com*
44

@@ -19,12 +19,12 @@ Get OHLC values for all instruments across various timeframes. Historical data c
1919
```python
2020
from __future__ import print_function
2121
import time
22-
import swagger_client
23-
from swagger_client.rest import ApiException
22+
import upstox_client
23+
from upstox_client.rest import ApiException
2424
from pprint import pprint
2525

2626
# create an instance of the API class
27-
api_instance = swagger_client.HistoryApi()
27+
api_instance = upstox_client.HistoryApi()
2828
instrument_key = 'instrument_key_example' # str |
2929
interval = 'interval_example' # str |
3030
to_date = 'to_date_example' # str |
@@ -73,12 +73,12 @@ Get OHLC values for all instruments across various timeframes. Historical data c
7373
```python
7474
from __future__ import print_function
7575
import time
76-
import swagger_client
77-
from swagger_client.rest import ApiException
76+
import upstox_client
77+
from upstox_client.rest import ApiException
7878
from pprint import pprint
7979

8080
# create an instance of the API class
81-
api_instance = swagger_client.HistoryApi()
81+
api_instance = upstox_client.HistoryApi()
8282
instrument_key = 'instrument_key_example' # str |
8383
interval = 'interval_example' # str |
8484
to_date = 'to_date_example' # str |
@@ -129,12 +129,12 @@ Get OHLC values for all instruments for the present trading day
129129
```python
130130
from __future__ import print_function
131131
import time
132-
import swagger_client
133-
from swagger_client.rest import ApiException
132+
import upstox_client
133+
from upstox_client.rest import ApiException
134134
from pprint import pprint
135135

136136
# create an instance of the API class
137-
api_instance = swagger_client.HistoryApi()
137+
api_instance = upstox_client.HistoryApi()
138138
instrument_key = 'instrument_key_example' # str |
139139
interval = 'interval_example' # str |
140140
api_version = 'api_version_example' # str | API Version Header

docs/LoginApi.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# swagger_client.LoginApi
1+
# upstox_client.LoginApi
22

33
All URIs are relative to *https://api-v2.upstox.com*
44

@@ -19,12 +19,12 @@ This provides details on the login endpoint.
1919
```python
2020
from __future__ import print_function
2121
import time
22-
import swagger_client
23-
from swagger_client.rest import ApiException
22+
import upstox_client
23+
from upstox_client.rest import ApiException
2424
from pprint import pprint
2525

2626
# create an instance of the API class
27-
api_instance = swagger_client.LoginApi()
27+
api_instance = upstox_client.LoginApi()
2828
client_id = 'client_id_example' # str |
2929
redirect_uri = 'redirect_uri_example' # str |
3030
api_version = 'api_version_example' # str | API Version Header
@@ -74,16 +74,16 @@ Logout
7474
```python
7575
from __future__ import print_function
7676
import time
77-
import swagger_client
78-
from swagger_client.rest import ApiException
77+
import upstox_client
78+
from upstox_client.rest import ApiException
7979
from pprint import pprint
8080

8181
# Configure OAuth2 access token for authorization: OAUTH2
82-
configuration = swagger_client.Configuration()
82+
configuration = upstox_client.Configuration()
8383
configuration.access_token = 'YOUR_ACCESS_TOKEN'
8484

8585
# create an instance of the API class
86-
api_instance = swagger_client.LoginApi(swagger_client.ApiClient(configuration))
86+
api_instance = upstox_client.LoginApi(upstox_client.ApiClient(configuration))
8787
api_version = 'api_version_example' # str | API Version Header
8888

8989
try:
@@ -111,7 +111,7 @@ Name | Type | Description | Notes
111111
### HTTP request headers
112112

113113
- **Content-Type**: Not defined
114-
- **Accept**: application/json, */*
114+
- **Accept**: */*, application/json
115115

116116
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
117117

@@ -126,12 +126,12 @@ This API provides the functionality to obtain opaque token from authorization_co
126126
```python
127127
from __future__ import print_function
128128
import time
129-
import swagger_client
130-
from swagger_client.rest import ApiException
129+
import upstox_client
130+
from upstox_client.rest import ApiException
131131
from pprint import pprint
132132

133133
# create an instance of the API class
134-
api_instance = swagger_client.LoginApi()
134+
api_instance = upstox_client.LoginApi()
135135
api_version = 'api_version_example' # str | API Version Header
136136
code = 'code_example' # str | (optional)
137137
client_id = 'client_id_example' # str | (optional)

docs/MarketQuoteApi.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# swagger_client.MarketQuoteApi
1+
# upstox_client.MarketQuoteApi
22

33
All URIs are relative to *https://api-v2.upstox.com*
44

@@ -19,16 +19,16 @@ This API provides the functionality to retrieve the full market quotes for one o
1919
```python
2020
from __future__ import print_function
2121
import time
22-
import swagger_client
23-
from swagger_client.rest import ApiException
22+
import upstox_client
23+
from upstox_client.rest import ApiException
2424
from pprint import pprint
2525

2626
# Configure OAuth2 access token for authorization: OAUTH2
27-
configuration = swagger_client.Configuration()
27+
configuration = upstox_client.Configuration()
2828
configuration.access_token = 'YOUR_ACCESS_TOKEN'
2929

3030
# create an instance of the API class
31-
api_instance = swagger_client.MarketQuoteApi(swagger_client.ApiClient(configuration))
31+
api_instance = upstox_client.MarketQuoteApi(upstox_client.ApiClient(configuration))
3232
symbol = 'symbol_example' # str | Comma separated list of symbols
3333
api_version = 'api_version_example' # str | API Version Header
3434

@@ -73,16 +73,16 @@ This API provides the functionality to retrieve the OHLC quotes for one or more
7373
```python
7474
from __future__ import print_function
7575
import time
76-
import swagger_client
77-
from swagger_client.rest import ApiException
76+
import upstox_client
77+
from upstox_client.rest import ApiException
7878
from pprint import pprint
7979

8080
# Configure OAuth2 access token for authorization: OAUTH2
81-
configuration = swagger_client.Configuration()
81+
configuration = upstox_client.Configuration()
8282
configuration.access_token = 'YOUR_ACCESS_TOKEN'
8383

8484
# create an instance of the API class
85-
api_instance = swagger_client.MarketQuoteApi(swagger_client.ApiClient(configuration))
85+
api_instance = upstox_client.MarketQuoteApi(upstox_client.ApiClient(configuration))
8686
symbol = 'symbol_example' # str | Comma separated list of symbols
8787
interval = 'interval_example' # str | Interval to get ohlc data
8888
api_version = 'api_version_example' # str | API Version Header
@@ -129,16 +129,16 @@ This API provides the functionality to retrieve the LTP quotes for one or more i
129129
```python
130130
from __future__ import print_function
131131
import time
132-
import swagger_client
133-
from swagger_client.rest import ApiException
132+
import upstox_client
133+
from upstox_client.rest import ApiException
134134
from pprint import pprint
135135

136136
# Configure OAuth2 access token for authorization: OAUTH2
137-
configuration = swagger_client.Configuration()
137+
configuration = upstox_client.Configuration()
138138
configuration.access_token = 'YOUR_ACCESS_TOKEN'
139139

140140
# create an instance of the API class
141-
api_instance = swagger_client.MarketQuoteApi(swagger_client.ApiClient(configuration))
141+
api_instance = upstox_client.MarketQuoteApi(upstox_client.ApiClient(configuration))
142142
symbol = 'symbol_example' # str | Comma separated list of symbols
143143
api_version = 'api_version_example' # str | API Version Header
144144

0 commit comments

Comments
 (0)