A Python package to calculate Zerodha brokerage charges for various trading segments
Project description
📊 Zerodha Brokerage Calculator
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.
🌟 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
Built with ❤️ by Hemang Joshi
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
Built Distribution
Close
Hashes for zerodha_brokerage_calculator-0.2.0.tar.gz
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | a5f7e53fef4dae79f563ce3816302d230710869dc973c937c9595e9d7c3ee68b |
|
| MD5 | 5482d1676e943cc5b1db12d87e8b9bed |
|
| BLAKE2b-256 | b73fdd1c49a5c37784439817a1acd2fec334c72d109d820c356f0872e3576bef |
Close
Hashes for zerodha_brokerage_calculator-0.2.0-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | c4caf9c47406a3667959c592bdb788e4f4d9d09c0a358d724792ce5e0f959432 |
|
| MD5 | b672a684db657b24120ac84aac94c896 |
|
| BLAKE2b-256 | 035e64d8d78b4117ad46a658fead55343be74d1546d22bf306c954aee34fff34 |