The foundational SDK for accessing Groww APIs and listening to live data streams. This package provides the core functionalities required to interact with Groww's trading platform.
Project description
growwapi SDK API Documentation
Overview
growwapi is the foundational SDK for accessing Groww APIs and listening to live data streams. This package provides the core functionalities to interact with Groww's trading platform.
Features
- Connect to Groww's API
- Place, modify, and cancel orders
- Retrieve order details, status, holdings, trade lists
- Subscribe and unsubscribe to market feeds
- Get live market data and updates
Installation
Install the package using pip:
pip install growwapi
Usage
Authentication
To use the SDK, you need to authenticate using your API credentials. Set the following variables:
API_AUTH_TOKEN: Your API authentication token.
API Client
The GrowwAPI class provides methods to interact with the Groww API.
from growwapi import GrowwAPI
groww_client = GrowwAPI("YOUR_API_KEY")
# Get the current orders. Will wait for 5 seconds or until the orders are received
orders = groww_client.get_order_list(timeout=5)
print(orders)
Feed Client
The GrowwFeed class provides methods to subscribe to and receive Groww data streams and updates.
It can either be used synchronously to get the last updated data or asynchronously to trigger a callback whenever new data is received.
from growwapi import GrowwFeed
from growwapi import GrowwAPI
groww_feed = GrowwFeed("YOUR_API_KEY")
# Synchronous Usage: Create a subscription and then get the LTP
groww_feed.subscribe_live_data(GrowwAPI.SEGMENT_CASH, "SWIGGY")
# Will wait for 3 seconds or until the LTP is received
ltp = groww_feed.get_stocks_ltp("SWIGGY", timeout=3)
print(ltp)
# Asynchronous Usage: Callback triggered whenever the LTP changes
def get_ltp_print():
# As it was triggerred on data received, we can directly get the LTP
ltp = groww_feed.get_stocks_ltp("RELIANCE")
print(ltp)
groww_feed.subscribe_live_data(GrowwAPI.SEGMENT_CASH, "RELIANCE", on_data_received=get_ltp_print)
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file growwapi-1.5.0.tar.gz.
File metadata
- Download URL: growwapi-1.5.0.tar.gz
- Upload date:
- Size: 69.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
546be8517f1223dda1f5338a549b3499c2b7cabd1e165b64fef21ab386136b66
|
|
| MD5 |
015910574019472d4db336ba422df02a
|
|
| BLAKE2b-256 |
9665c2e00e09d9f33593a5c6b8f06ded511cd1bf14cdf42c09f63c6a925b50ab
|
File details
Details for the file growwapi-1.5.0-py3-none-any.whl.
File metadata
- Download URL: growwapi-1.5.0-py3-none-any.whl
- Upload date:
- Size: 76.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4871ed19415b6ad7434bee2178f53aa1e180fbddd4a25693c458440f66939cc
|
|
| MD5 |
cea135f58965b2432f678c2f99f7b1eb
|
|
| BLAKE2b-256 |
e1697dd0766c3a9dcf2688eb363a90fadca7a8388ac947efebd737b830bd478a
|