Skip to main content

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:

  1. Environment Variables: Store your Kite Connect API key and secret in a .env file 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")
    

Metadata

Release files for easy_kite_methods 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easy_kite_methods 0.0.8
File Size Uploaded
easy_kite_methods-0.0.8.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for easy_kite_methods 0.0.8
File Interpreter ABI Platform
easy_kite_methods-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / easy_kite_methods-0.0.8.tar.gz

Download URL easy_kite_methods-0.0.8.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
847eafeee887f57492a023e0c488d59493e2a8741721fa2921cc317e97a3184a
BLAKE2b-256 checksum
How to use checksums
e090cc9a2addba18fa3aa779106093e86a9b7cd2499a7fc13b5108f442e98291
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/23.2.0

Release files / easy_kite_methods-0.0.8-py3-none-any.whl

Download URL easy_kite_methods-0.0.8-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5c25ef227879f27c824934adf22e53708dcc286cef058a057978c4b4a8d8a5b
BLAKE2b-256 checksum
How to use checksums
2cb883cf8b5341917b488c2ba88039e50c18dc63b24c6658119e5093c0cad548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/23.2.0

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page