Skip to content

Adding new apis #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading