Skip to content

Commit

Permalink
Merge pull request #72 from upstox/addingNewApis
Browse files Browse the repository at this point in the history
Adding new apis
  • Loading branch information
KetanGupta12 authored Jul 26, 2024
2 parents 05590e7 + 2a7ec38 commit 08e0679
Show file tree
Hide file tree
Showing 38 changed files with 4,350 additions and 138 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def main():
configuration.access_token = access_token

streamer = upstox_client.MarketDataStreamer(
upstox_client.ApiClient(configuration), ["NSE_INDEX|Nifty 50", "NSE_INDEX|Bank Nifty"], "full")
upstox_client.ApiClient(configuration), ["NSE_INDEX|Nifty 50", "NSE_INDEX|Nifty Bank"], "full")

streamer.on("message", on_message)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
long_description = (this_directory / "README.md").read_text()

NAME = "upstox-python-sdk"
VERSION = "2.4.1"
VERSION = "2.4.3"
# To install the library, run the following
#
# python setup.py install
Expand Down
15 changes: 0 additions & 15 deletions test/order/cancel_order.py

This file was deleted.

16 changes: 0 additions & 16 deletions test/order/modify_order.py

This file was deleted.

12 changes: 0 additions & 12 deletions test/order/place_order.py

This file was deleted.

1 change: 1 addition & 0 deletions test/sdk_tests/data_token.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
access_token = "your_access_token"
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import upstox_client
import data_token

configuration = upstox_client.Configuration()
access_token = "your_access_token"
configuration.access_token = access_token
configuration.access_token = data_token.access_token
streamer = upstox_client.MarketDataStreamer(
upstox_client.ApiClient(configuration), instrumentKeys=["MCX_FO|426302", "NSE_EQ|INE528G01035"], mode="full")

Expand Down
26 changes: 26 additions & 0 deletions test/sdk_tests/portfolio_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import upstox_client
import data_token


def on_message(message):
print(message)


def on_open():
print("connection opened")


def main():
configuration = upstox_client.Configuration()
configuration.access_token = data_token.access_token

streamer = upstox_client.PortfolioDataStreamer(
upstox_client.ApiClient(configuration))

streamer.on("message", on_message)
streamer.on("open", on_open)
streamer.connect()


if __name__ == "__main__":
main()
Loading

0 comments on commit 08e0679

Please sign in to comment.