Skip to main content

A Python package to calculate Zerodha brokerage charges for various trading segments

Project description

📊 Zerodha Brokerage Calculator

MIT License Python Package PyPI version

A powerful Python package that simplifies the calculation of Zerodha brokerage charges across various trading segments including equities, commodities, and currencies. Built with precision and ease of use in mind.

image

🌟 Features

  • Comprehensive Coverage: Support for multiple trading segments
  • 🚀 Easy Integration: Simple API for quick implementation
  • 💯 Accurate Calculations: Precise brokerage and charges computation
  • 🔄 Real-time Updates: Always current with latest Zerodha charges

📦 Installation

Get started with a simple pip install:

pip install zerodha-brokerage-calculator

🚀 Quick Start

Here's a quick example to calculate equity intraday charges:

from zerodha_brokerage_calculator import calculate_equity_intraday

# Calculate charges for an intraday equity trade
result = calculate_equity_intraday(
    buy_price=1000,
    sell_price=1100,
    quantity=400,
    exchange='NSE'
)

print(f"Net Profit: ₹{result['net_profit']:,.2f}")
print(f"Total Charges: ₹{result['total_charges']:,.2f}")

📘 Available Functions

📈 Equity Trading

Function Description
calculate_equity_intraday() Calculate intraday trading charges
calculate_equity_delivery() Calculate delivery trading charges
calculate_equity_futures() Calculate futures trading charges
calculate_equity_options() Calculate options trading charges

💱 Currency Trading

Function Description
calculate_currency_futures() Calculate currency futures charges
calculate_currency_options() Calculate currency options charges

🏭 Commodities Trading

Function Description
calculate_commodity_futures() Calculate commodity futures charges
calculate_commodity_options() Calculate commodity options charges

📊 Function Parameters

Parameter Description Type
buy_price Purchase price of the asset float
sell_price Selling price of the asset float
quantity Number of units traded int
exchange Trading exchange (NSE/BSE/MCX) str
multiplier Contract size multiplier (for commodities) float

📋 Return Values

Each function returns a comprehensive dictionary containing:

{
    'turnover': float,          # Total transaction value
    'brokerage': float,         # Brokerage charges
    'stt': float,              # Securities Transaction Tax
    'exchange_txn_charges': float,  # Exchange transaction charges
    'sebi_charges': float,      # SEBI charges
    'gst': float,              # Goods and Services Tax
    'stamp_duty': float,        # Stamp duty charges
    'total_charges': float,     # Sum of all charges
    'gross_profit': float,      # Profit before charges
    'net_profit': float,        # Profit after charges
    'points_to_breakeven': float # Required points for breakeven
}

📁 Package Structure

zerodha_brokerage_calculator/
├── zerodha_brokerage_calculator/
│   ├── __init__.py
│   └── calculator.py
├── README.md
├── setup.py
└── LICENSE

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

📫 Contact & Support

Website WhatsApp Email LinkedIn Twitter Stack Overflow


Built with ❤️ by Hemang Joshi

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

zerodha_brokerage_calculator-0.2.0.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page