- About
- Screenshots
- Features
- Tech Stack
- Getting Started
- Usage
- Investment Strategies
- Contributing
- Disclaimers
- Useful Resources
- License
A Python-based investment planning tool inspired by Monika Halan's Framework for Indian mutual fund investors. It provides personalized asset allocation plans based on age, risk profile, and financial goals.
Investment Planning
- β¨ Age-appropriate strategy selection
- π Risk-based allocation (Conservative/Moderate/Aggressive)
- π Multiple equity strategies
- π° SIP & Lumpsum investment planning
Portfolio Management
- π Portfolio rebalancing suggestions
- π± Interactive visualizations
- π Downloadable reports (CSV/JSON)
- β‘ Real-time calculations
Core
- Python 3.8 or higher
- pip package manager
pip install -r requirements.txtstreamlit run streamlit_app.pyThe app will automatically open in your default web browser at http://localhost:8501
-
Fill Profile Information (Left Sidebar)
- Enter age, monthly income, investment amounts
- Select allocation method for equity debt percentage split (Risk Profile/Custom)
- Choose strategies for allocation within equity
- Check emergency fund and insurance status
-
Generate Plan
- Click "π Generate Plan" button
- View personalized allocation instantly
-
Explore Recommendations
- Navigate through 2 tabs:
- Detailed Breakdown: Complete fund allocations
- Investment Plan: SIP/lumpsum amounts with rebalancing triggers
- Navigate through 2 tabs:
-
Export Your Plan
- Download SIP plan as CSV
- Download complete plan as JSON
from asset_allocation_engine import (
AssetAllocationEngine,
UserProfile
)
# Create user profile
profile = UserProfile(
age=30,
monthly_income=100000,
monthly_investment=30000,
lump_sum_investment=500000,
has_emergency_fund=True,
has_adequate_insurance=True
)
# Generate plan
engine = AssetAllocationEngine()
plan = engine.create_plan(
profile=profile,
equity_strategy="balanced_growth",
debt_strategy="long_term",
add_international=True
)
# Access plan details
print(f"Equity: {plan.equity_percentage}%")
print(f"Debt: {plan.debt_percentage}%")
print(f"Total Funds: {plan.get_total_funds_count()}")
# Export to dict
plan_dict = plan.export_to_dict()Caution
Experimental require development and testing
from asset_allocation_engine import PortfolioRebalancer
# Current portfolio values
current_values = {
"largecap": 400000,
"midcap": 150000,
"smallcap": 180000,
"fd": 270000
}
# Target allocations from your plan
target_allocations = {
"largecap": 45.0,
"midcap": 30.0,
"smallcap": 25.0,
"fd": 30.0
}
# Calculate current percentages
rebalancer = PortfolioRebalancer()
current_pct = rebalancer.calculate_current_allocation(current_values)
# Check if rebalancing needed
needs_rebalance, drifted_funds = rebalancer.check_rebalancing_needed(
current_pct, target_allocations, drift_threshold=5.0
)
if needs_rebalance:
# Calculate trades required
trades = rebalancer.calculate_rebalance_trades(
current_values, target_allocations
)
for fund, amount in trades.items():
action = "BUY" if amount > 0 else "SELL"
print(f"{action} {fund}: βΉ{abs(amount):,.0f}")| Strategy | Large/Index | Mid-Cap | Small-Cap | Risk Level (Relative) | Best For |
|---|---|---|---|---|---|
| Index Core | 100% | - | - | Low | Cost-conscious investors seeking market returns |
| Market Weighted | 70% | 20% | 10% | Low-Moderate | Conservative equity investors, age 50+ |
| Balanced Growth | 45% | 30% | 25% | Moderate | Mid-career (35-50), seeking balanced growth |
| Aggressive Growth | 35% | 35% | 30% | High | Young investors (20-35), high risk tolerance |
| Strategy | Debt Component | Risk Level | Best For |
|---|---|---|---|
| Long Term FD | 100% FD | Very Low | Safe, stable returns for long-term goals |
Note
Additional debt options based on user profile and goals are planned for future updates.
Contributions welcome! Areas for improvement:
- Goal-Based Allocation: Full implementation of goal-specific portfolios
- Comprehensive Recommendations: More through recommendations based on user profile
- Rebalancing Suggestions: Create rebalancing plan if portfolio allocation deviates beyond specified threshold.
For questions, suggestions, or issues:
- Create an issue on GitHub
- Review the code and documentation
This project is open-source and available under the Apache License 2.0.
- Let's Talk Mutual Funds - Monika Halan (Primary reference for this tool)
- The Little Book of Common Sense Investing - John Bogle
- One Up on Wall Street - Peter Lynch
- The Intelligent Investor - Benjamin Graham
Research & Analysis
Investment Platforms
- Direct Plans: Coin (Zerodha), Kuvera, Groww
- Advisory: Smallcase, Wright Research
Warning
This tool is for educational purposes only. Always consult financial professionals for personalized advice.
Important Notes
-
Not Financial Advice
- This tool provides educational guidance only
- NOT a substitute for professional financial advice
-
Market Risk
- All investments subject to market risk
- Past performance doesn't guarantee future returns
-
Professional Guidance
- Consult SEBI-registered investment advisor
- Seek tax professional for tax planning
-
Regular Review
- Review allocation annually
- Adjust based on life changes
Remember: The best investment strategy is one you can stick with through market ups and downs. Stay disciplined, stay diversified, and think long-term! ππ°


