A Python client for the DhanHQ API
Project description
DhanHQ API Python Client
A Python client for interacting with the DhanHQ API. This library provides a simple interface to access various endpoints of the DhanHQ API.
Installation
You can install the package using pip:
pip install dhanhq_api
from dhanhq_api import DhanHQAPI, OrderRequest
# Initialize the API client with your client ID and access token
api = DhanHQAPI(client_id="your_client_id_here", access_token="your_access_token_here")
# Place an order
order_request = OrderRequest(
dhanClientId="your_client_id",
transactionType="BUY",
exchangeSegment="NSE_EQ",
securityId="INFY",
quantity=10,
price=1500.0
)
response = api.place_order(order_request)
print(response)
# Get all trades
trades = api.get_all_trades()
print(trades)
Available Methods
get_order_by_id(order_id)
modify_order(order_id, order_modify_request)
cancel_order(order_id)
get_orders()
place_order(order_request)
place_slice_order(order_request)
get_all_trades()
get_trade_by_order_id(order_id)
get_trade_history(from_date, to_date, page_number)
convert_position(position_conversion_request)
get_positions()
get_holdings()
generate_edis_form(edis_form_request)
generate_bulk_edis_form(edis_bulk_form_request)
generate_edis_tpin()
get_edis_authorized_quantity(isin)
manage_kill_switch(kill_switch_status)
margin_calculator(know_your_margin_req)
get_fund_limit_details()
get_ledger_report(from_date=None, to_date=None)
fetch_intraday_charts(intraday_charts_request)
fetch_historical_charts(historical_charts_request)
Contributing
Contributions are welcome! Please feel free to submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
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
dhanhq_api-0.1.0.tar.gz
(2.7 kB
view details)
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 dhanhq_api-0.1.0.tar.gz.
File metadata
- Download URL: dhanhq_api-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bac7eeddc541274eafacbb4d8064d5cab2f40a4d645263a16e5e229507fd3d5
|
|
| MD5 |
d4950b8542d57f3e69942f2fdf3c9e1a
|
|
| BLAKE2b-256 |
e18550d122c4ce5da17cea366164a8324fb55ec36fa33e5d1bd3c9f9a8c3855e
|
File details
Details for the file dhanhq_api-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dhanhq_api-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2d6ddf445341e4cb247f1cc78672de519d210a7a60eff945af3bff500d115a5
|
|
| MD5 |
3efd67182451d6fd27615ef0000d7727
|
|
| BLAKE2b-256 |
46ec7b10b0e0df957d13e1c23aceee45d843feb366986221317586ef4719ebfd
|