Spaces:
Sleeping
Sleeping
title: Mutual Fund | |
emoji: π | |
colorFrom: gray | |
colorTo: green | |
sdk: docker | |
pinned: false | |
license: apache-2.0 | |
short_description: mutual fund agentic ai | |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
--- | |
# Mutual Fund Investment Decision Support System API | |
This is a FastAPI backend for the Mutual Fund Investment Decision Support System. It provides all the functionality of the original Streamlit app through a RESTful API. | |
## Features | |
- Market data retrieval (Nifty 50, Sensex, etc.) | |
- Mutual fund data fetching and analysis | |
- SIP calculator with projections | |
- Goal-based investment planning | |
- Portfolio analysis and tracking | |
- AI-powered investment recommendations | |
- Portfolio rebalancing suggestions | |
- Performance reporting | |
## Project Structure | |
mutual_fund_api/ | |
βββ app/ | |
β βββ init.py | |
β βββ main.py | |
β βββ config.py | |
β βββ models/ | |
β β βββ init.py | |
β β βββ fund_models.py | |
β β βββ portfolio_models.py | |
β β βββ goal_models.py | |
β β βββ ai_models.py | |
β βββ services/ | |
β β βββ init.py | |
β β βββ data_fetcher.py | |
β β βββ sip_calculator.py | |
β β βββ portfolio_analyzer.py | |
β β βββ ai_swarm.py | |
β βββ api/ | |
β β βββ init.py | |
β β βββ endpoints/ | |
β β β βββ init.py | |
β β β βββ market.py | |
β β β βββ funds.py | |
β β β βββ portfolio.py | |
β β β βββ goals.py | |
β β β βββ ai.py | |
β βββ utils/ | |
β βββ init.py | |
β βββ helpers.py | |
βββ requirements.txt | |
βββ .env | |
βββ README.md | |
## Setup | |
1. Clone the repository | |
2. Create a virtual environment: `python -m venv venv` | |
3. Activate the virtual environment: | |
- Windows: `venv\Scripts\activate` | |
- Unix/macOS: `source venv/bin/activate` | |
4. Install dependencies: `pip install -r requirements.txt` | |
5. Create a `.env` file with your Swarms API key | |
6. Run the API: `uvicorn app.main:app --reload` | |
## API Documentation | |
Once the server is running, you can access the interactive API documentation at: | |
- Swagger UI: http://localhost:8000/docs | |
- ReDoc: http://localhost:8000/redoc | |
## Key Endpoints | |
### Market Data | |
- `GET /api/v1/market/indices` - Get market indices data | |
### Funds | |
- `GET /api/v1/funds/schemes` - Get all mutual fund schemes | |
- `GET /api/v1/funds/nav/{scheme_code}` - Get NAV history for a fund | |
- `GET /api/v1/funds/popular` - Get popular funds by category | |
- `POST /api/v1/funds/sip-calculate` - Calculate SIP returns | |
- `POST /api/v1/funds/required-sip` - Calculate required SIP for a goal | |
- `POST /api/v1/funds/analyze` - Analyze fund performance | |
### Portfolio | |
- `POST /api/v1/portfolio/metrics` - Calculate portfolio metrics | |
- `POST /api/v1/portfolio/rebalance` - Get rebalancing recommendations | |
- `POST /api/v1/portfolio/performance` - Generate performance report | |
- `GET /api/v1/portfolio/template/{template}` - Get portfolio template | |
- `GET /api/v1/portfolio/templates` - Get all portfolio templates | |
### Goals | |
- `POST /api/v1/goals/dashboard` - Calculate goals dashboard metrics | |
- `POST /api/v1/goals/calculate-sip` - Calculate SIP returns | |
- `POST /api/v1/goals/required-sip` - Calculate required SIP for a goal | |
- `POST /api/v1/goals/inflation-adjusted` - Calculate inflation-adjusted amount | |
### AI Recommendations | |
- `POST /api/v1/ai/analyze` - Get comprehensive AI recommendations | |
- `POST /api/v1/ai/fund-selection` - Get fund selection recommendations | |
- `POST /api/v1/ai/risk-assessment` - Get risk assessment | |
- `POST /api/v1/ai/goal-planning` - Get goal planning recommendations | |