TradeKart API
TradeKart API is a Python wrapper around the official Groww SDK with a service-oriented design for trading workflows.
It provides custom service layers for common operations (Orders, Portfolio) with request models, response models, and consistent exception handling so teams can build reliable trading integrations faster.
Why TradeKart API
- Built on top of
growwapi, so you can continue to use Groww's official SDK. - Clean service abstraction for business use-cases instead of raw SDK calls everywhere.
- Typed request models for safer payload construction.
- Structured response handling for predictable downstream processing.
- Custom exceptions for easier debugging and application-level error handling.
System Design
Installation
pip install tradekartapi
Quick Start (Jupyter / Notebook)
from tradekartapi.client import TradeKartClient
from growwapi import GrowwAPI
access_token = "your_access_token"
client = TradeKartClient.from_access_token(access_token, GrowwAPI)
# Now client is ready to use the service
Service Architecture
TradeKart API uses:
- Groww SDK Adapter to initialize and hold the SDK client.
- Custom Services to expose trading operations as business-level methods.
- Models to keep request and response shapes explicit and reusable.
Available Services
- Order Service
- Place order
- Modify order
- Cancel order
- Get order status
- Get order list
- Get order detail
- Portfolio Service
- Get holdings
- Get positions
- Get positions by trading symbol
Margin Service
Margin-related service support is planned as part of upcoming releases.
Orders Example
from tradekartapi.models.orders import PlaceOrderRequest
from tradekartapi.models.annexures import (
Exchange, Segment, Product, OrderType, TransactionType, Validity
)
request = PlaceOrderRequest(
trading_symbol="SBIN",
quantity=1,
validity=Validity.DAY,
exchange=Exchange.NSE,
segment=Segment.CASH,
product=Product.CNC,
order_type=OrderType.MARKET,
transaction_type=TransactionType.BUY,
)
response = client.order_service.place_order(request)
print(response)
Portfolio Example
holdings = client.portfolio_service.get_holdings()
positions = client.portfolio_service.get_positions()
print([h.to_dict() for h in holdings])
print([p.to_dict() for p in positions])
Response Formats
Depending on the service method, you may receive:
- Native
dictfrom direct SDK passthrough methods. - Dataclass-based response objects from modeled service methods.
For dataclass responses, use:
to_dict()for Python dictionary output.to_json()for JSON string output.
Error Handling
TradeKart API raises structured custom exceptions for validation and service-level failures, making it easier to map failures to API responses or logs in production systems.
Compatibility
- Python
>=3.10 - Depends on
growwapi
Changelog
Full changelog: https://tradekartapi.readthedocs.io/en/latest/changelog.html
License
MIT
Metadata
Release files for tradekartapi 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tradekartapi-0.2.6.tar.gz | 22.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tradekartapi-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.9 kB
Release files / tradekartapi-0.2.6.tar.gz
| Download URL | tradekartapi-0.2.6.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
423eacd3e9631bb737be28ca8fe02a8efa04c0e8d18dd595dfd9674aab648035
|
|
BLAKE2b-256 checksum How to use checksums |
f7a0eb2b31a7ed2e62e9de058c37e45a171098f02cc8a07680a7db309cbfdc55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / tradekartapi-0.2.6-py3-none-any.whl
| Download URL | tradekartapi-0.2.6-py3-none-any.whl |
|---|---|
| Size | 29.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b7f65102bb5f0252d6f7b6428c2f49bb1dd979848c592b2330d77d56d3390a8
|
|
BLAKE2b-256 checksum How to use checksums |
64ea8b36100c384e3eb8ef23ab27f09203693aa9ee722930e2526d52146692cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|