Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,3 +10,107 @@ short_description: mutual fund agentic ai
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Mutual Fund Investment Decision Support System API
|
| 16 |
+
|
| 17 |
+
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.
|
| 18 |
+
|
| 19 |
+
## Features
|
| 20 |
+
|
| 21 |
+
- Market data retrieval (Nifty 50, Sensex, etc.)
|
| 22 |
+
- Mutual fund data fetching and analysis
|
| 23 |
+
- SIP calculator with projections
|
| 24 |
+
- Goal-based investment planning
|
| 25 |
+
- Portfolio analysis and tracking
|
| 26 |
+
- AI-powered investment recommendations
|
| 27 |
+
- Portfolio rebalancing suggestions
|
| 28 |
+
- Performance reporting
|
| 29 |
+
|
| 30 |
+
## Project Structure
|
| 31 |
+
|
| 32 |
+
mutual_fund_api/
|
| 33 |
+
βββ app/
|
| 34 |
+
β βββ init.py
|
| 35 |
+
β βββ main.py
|
| 36 |
+
β βββ config.py
|
| 37 |
+
β βββ models/
|
| 38 |
+
β β βββ init.py
|
| 39 |
+
β β βββ fund_models.py
|
| 40 |
+
β β βββ portfolio_models.py
|
| 41 |
+
β β βββ goal_models.py
|
| 42 |
+
β β βββ ai_models.py
|
| 43 |
+
β βββ services/
|
| 44 |
+
β β βββ init.py
|
| 45 |
+
β β βββ data_fetcher.py
|
| 46 |
+
β β βββ sip_calculator.py
|
| 47 |
+
β β βββ portfolio_analyzer.py
|
| 48 |
+
β β βββ ai_swarm.py
|
| 49 |
+
β βββ api/
|
| 50 |
+
β β βββ init.py
|
| 51 |
+
β β βββ endpoints/
|
| 52 |
+
β β β βββ init.py
|
| 53 |
+
β β β βββ market.py
|
| 54 |
+
β β β βββ funds.py
|
| 55 |
+
β β β βββ portfolio.py
|
| 56 |
+
β β β βββ goals.py
|
| 57 |
+
β β β βββ ai.py
|
| 58 |
+
β βββ utils/
|
| 59 |
+
β βββ init.py
|
| 60 |
+
β βββ helpers.py
|
| 61 |
+
βββ requirements.txt
|
| 62 |
+
βββ .env
|
| 63 |
+
βββ README.md
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
## Setup
|
| 67 |
+
|
| 68 |
+
1. Clone the repository
|
| 69 |
+
2. Create a virtual environment: `python -m venv venv`
|
| 70 |
+
3. Activate the virtual environment:
|
| 71 |
+
- Windows: `venv\Scripts\activate`
|
| 72 |
+
- Unix/macOS: `source venv/bin/activate`
|
| 73 |
+
4. Install dependencies: `pip install -r requirements.txt`
|
| 74 |
+
5. Create a `.env` file with your Swarms API key
|
| 75 |
+
6. Run the API: `uvicorn app.main:app --reload`
|
| 76 |
+
|
| 77 |
+
## API Documentation
|
| 78 |
+
|
| 79 |
+
Once the server is running, you can access the interactive API documentation at:
|
| 80 |
+
- Swagger UI: http://localhost:8000/docs
|
| 81 |
+
- ReDoc: http://localhost:8000/redoc
|
| 82 |
+
|
| 83 |
+
## Key Endpoints
|
| 84 |
+
|
| 85 |
+
### Market Data
|
| 86 |
+
- `GET /api/v1/market/indices` - Get market indices data
|
| 87 |
+
|
| 88 |
+
### Funds
|
| 89 |
+
- `GET /api/v1/funds/schemes` - Get all mutual fund schemes
|
| 90 |
+
- `GET /api/v1/funds/nav/{scheme_code}` - Get NAV history for a fund
|
| 91 |
+
- `GET /api/v1/funds/popular` - Get popular funds by category
|
| 92 |
+
- `POST /api/v1/funds/sip-calculate` - Calculate SIP returns
|
| 93 |
+
- `POST /api/v1/funds/required-sip` - Calculate required SIP for a goal
|
| 94 |
+
- `POST /api/v1/funds/analyze` - Analyze fund performance
|
| 95 |
+
|
| 96 |
+
### Portfolio
|
| 97 |
+
- `POST /api/v1/portfolio/metrics` - Calculate portfolio metrics
|
| 98 |
+
- `POST /api/v1/portfolio/rebalance` - Get rebalancing recommendations
|
| 99 |
+
- `POST /api/v1/portfolio/performance` - Generate performance report
|
| 100 |
+
- `GET /api/v1/portfolio/template/{template}` - Get portfolio template
|
| 101 |
+
- `GET /api/v1/portfolio/templates` - Get all portfolio templates
|
| 102 |
+
|
| 103 |
+
### Goals
|
| 104 |
+
- `POST /api/v1/goals/dashboard` - Calculate goals dashboard metrics
|
| 105 |
+
- `POST /api/v1/goals/calculate-sip` - Calculate SIP returns
|
| 106 |
+
- `POST /api/v1/goals/required-sip` - Calculate required SIP for a goal
|
| 107 |
+
- `POST /api/v1/goals/inflation-adjusted` - Calculate inflation-adjusted amount
|
| 108 |
+
|
| 109 |
+
### AI Recommendations
|
| 110 |
+
- `POST /api/v1/ai/analyze` - Get comprehensive AI recommendations
|
| 111 |
+
- `POST /api/v1/ai/fund-selection` - Get fund selection recommendations
|
| 112 |
+
- `POST /api/v1/ai/risk-assessment` - Get risk assessment
|
| 113 |
+
- `POST /api/v1/ai/goal-planning` - Get goal planning recommendations
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
|