No project description provided
Project description
easy_kite_methods
The easy_kite_methods package provides a seamless interface for interacting with the Kite Connect API for stock trading on the Zerodha platform.
Kite Connect Python Client - https://kite.trade/docs/pykiteconnect/v4/ .
Kite HTTP API Documentation - https://kite.trade/docs/connect/v3/.
Installation
To install the easy_kite_methods package, run the following command:
pip install easy_kite_methods
Configuration
Before using the easy_kite_methods package, you must configure your environment with necessary API keys and secrets. Follow these steps to set up your environment:
-
Environment Variables: Store your Kite Connect API key and secret in a
.envfile at the root of your project. This file should contain:KITE_API_KEY=your_api_key_here KITE_API_SECRET=your_api_secret_here
Usage
Import the package using the alias ekm and utilize its functions for interacting with the Zerodha Kite Connect API.
Example Imports
import easy_kite_methods as ekm
Placing Orders
-
Buy an Intraday Normal Order:
order_id = ekm.buy_intraday_normal_order(stock_name="RELIANCE", quantity=1)
-
Sell an Intraday Normal Order:
order_id = ekm.sell_intraday_normal_order(stock_name="TCS", quantity=2)
-
Buy an Intraday Limit Order:
order_id = ekm.buy_intraday_limit_order(stock_name="RELIANCE", quantity=1,price=2900)
-
Sell an Intraday Limit Order:
order_id = ekm.sell_intraday_limit_order(stock_name="TCS", quantity=2,price=2300)
-
Place Stop Loss Market Order:
order_id = ekm.place_slm_order(stock_name="INFY", quantity=10, order_type="BUY", price=1500)
Modifying Orders
-
Varieties can be [REGULAR,BO,CO,AMO]r:
ekm.modify_order(variety="REGULAR", orderId="your_order_id_here", quantity=2, price=3550)
ekm.modify_order_quantity(variety="REGULAR", order_id="order123", quantity=15)
ekm.modify_order_price(variety="AMO", order_id="order123", price=1520)
ekm.modify_order_to_buy(variety="CO", order_id="order123")
ekm.modify_order_to_sell(variety="BO", order_id="order123")
Fetching Account Details
-
Fetch Holdings:
holdings = ekm.get_holdings()
-
Fetch Positions:
positions = ekm.get_positions()
-
Cancel or Exit Orders:
ekm.cancel_order(order_id="order123")
ekm.exit_orders(order_id="order123")
Additional Useful APIS
-
**Get Status and Average Price [COMPLETED,REJECTED] as an example **:
order_status = ekm.get_status(order_id="order123")
average_price,status = ekm.get_average_price_and_status(order_id="order123")
order_history = ekm.get_order_history(order_id="order123")
Fetching Live Data
-
Get Stock Price:
stock_price = ekm.get_stock_price(name="RELIANCE")
-
Get Stock Instrument Token:
token = ekm.get_stock_instrument_token(stock_name="RELIANCE")
-
Get FNO Instrument Price:
stock_price = ekm.get_fno_price(name="BANKNIFTY24APRFUT")
-
Get FNO Instrument Token:
token = ekm.get_fno_instrument_token(stock_name="BANKNIFTY24APRFUT")
Project details
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 easy_kite_methods-0.0.3.tar.gz.
File metadata
- Download URL: easy_kite_methods-0.0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a211405318c7eadd6e80cbd28c79c7cc76c95cb8fe47b904b3a1eb228a68f83
|
|
| MD5 |
47a911878cfd2f7dd0c061709d8a258a
|
|
| BLAKE2b-256 |
6f422139b93ba7c9bd7996065339c7d44f51dc4250ade99b38eb4e6416568c7b
|
File details
Details for the file easy_kite_methods-0.0.3-py3-none-any.whl.
File metadata
- Download URL: easy_kite_methods-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe7961e9a689ba6e64174589a1d175cff95da4fa1084331e86f31ecab14626da
|
|
| MD5 |
6a77de28a0a95ffbfb1db8c4a8e65178
|
|
| BLAKE2b-256 |
7fb0281f700fe9c051a82699c038be9ea31eb7fea0e1b6700c2d89a81f9c995e
|