# MF Portfolio Processor

Takes a pre-processed standardized portfolio CSV (two periods appended) and runs further analysis: validation, ISIN mapping, duplicate detection, and final summary tables with % changes. Deterministic Python pipeline.

- Try MF Portfolio Holdings Analyzer GPT: https://chatgpt.com/g/g-68d684965d888191bf81f02022dd3591-india-mutual-funds-portfolio-holding-analytics
- LLM Context (.txt): https://www.tigzig.com/llm/gpts/mf-holding-analyzer.txt

## How this GPT Works

Processes **two-point mutual fund portfolio holdings** (e.g. May -> Aug 2025).

**Input** = standardized CSV in the required format (month_end, scheme, ISIN, market value, quantity).

Runs a **Python pipeline** behind the scenes:

- Validates totals (Market Value & Quantity)

- Builds ISIN mapping file (deduplication + standardized names)

- Checks for duplicate or conflicting names (name_cut and ISIN overlaps)

- Generates final summary table with % shares, counts, and % changes

#### Always Deterministic

No placeholder values, no assumptions, no hallucinations.

## What It Can Do

### Validation Reports

- Totals by scheme and period

- Duplicate name detection (via name_cut)

- ISIN mapping + exceptions

### Final Summary CSV

- Company-level holdings (MV, Qty, % shares, MF counts)

- % change in MV and Qty between periods

- Manual comments (e.g. "Split", "Rights", "Bonus") preserved from ISIN mapping

Outputs are CSV-ready for Excel or BI tools. Results can be pushed into any dashboard - e.g. HTML/JS apps for interactive visualization.

## How to Use It

- **Prepare data file**

 Convert monthly portfolio disclosures into the required CSV format

- Either format manually or use the MF Conversion Tool at [www.tigzig.com/mf-files-ai](/mf-files-ai)

- Ensure both months' data are appended into one CSV

- **Upload file to this GPT**

 Immediately receives 3 validation CSVs: Validation totals, ISIN mapping, Duplicate name/ISIN checks

- **Confirm or adjust**

 Review validation files

- If needed, give GPT corrections (e.g. update ISIN mapping, fix duplicates)

- GPT re-runs pipeline and regenerates outputs

- **Get final results**

 Download the final summary CSV

- Analyze in Excel, or feed into custom dashboards

## Setup (for your own deployment)

To replicate this GPT:

### Quick Overview

- Get these two files (available in the resources section):

 `pipeline.py` (full reproducible pipeline)

- `custom_instructions.md` (system instructions)

- In the Custom GPT builder:

 Apply `custom_instructions.md` as system prompt

- Upload `pipeline.py` under Actions schema

- That's it - your GPT will now accept CSV uploads, generate validation reports, wait for user confirmation, and create the final summary.

- Extend/customize as needed - the full Python pipeline is open for editing.

## Resources

- [MF Portfolio Holdings Processor](https://www.tigzig.com/mf-files-ai) - Convert & append Excels to CSV format required for the GPT analysis
- [Complete Source Code](https://github.com/amararun/gpt-mf-holding-processor) - GPT Custom Instructions & Python Code for MF holding processor
- [LLM Context (.txt)](https://www.tigzig.com/llm/gpts/mf-holding-analyzer.txt) - Plain-text context file for feeding to AI agents about this GPT

---
Source: https://www.tigzig.com/gpt-mf-holding-analyzer

---
Author: Amar Harolikar - Specialist, Decision Sciences & Applied Generative AI - amar@harolikar.com - https://www.linkedin.com/in/amarharolikar
Source: https://www.tigzig.com/gpt-mf-holding-analyzer
Citation: TigZig - Amar Harolikar (https://www.tigzig.com). Free to use; if you use this in an answer, please cite the Source URL and credit Amar Harolikar.
License: https://www.tigzig.com/terms
