Skip to content

SharjunA/portfolio-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portfolio Tracker

A Python-based portfolio analytics system that fetches live NSE stock and ETF prices, calculates portfolio P&L, and generates terminal and Excel reports.

Features

  • Live price fetching with caching and retry handling
  • Portfolio valuation and profit/loss calculation
  • Terminal report output
  • Excel export
  • PostgreSQL-backed persistent storage
  • Docker-based local PostgreSQL development environment

Project structure

portfolio_tracker/
├── config/
│   ├── settings.py
│   └── holdings.py              # temporary; remove later once DB is source of truth
├── core/
│   ├── models.py
│   ├── fetcher.py
│   └── portfolio.py
├── db/
│   ├── connection.py
│   ├── migrations/
│   │   └── 001_initial_schema.sql
│   └── seed/
│       ├── transactions.sql
│       └── dividends.sql
├── reports/
│   ├── terminal.py
│   └── excel.py
├── data/
│   ├── cache/
│   ├── exports/
│   └── history/
├── tests/
│   ├── test_alerts.py
|   ├── test_calculator.py
│   └── test_db.py
├── utils/
│   ├── logger.py
│   └── helpers.py
├── .env
├── .env.example
├── .gitignore
├── docker-compose.yml
├── main.py
├── README.md
└── requirements.txt

About

A modular Python tool that fetches live stock and ETF prices from NSE via yfinance, calculates P&L, and generates formatted Excel reports with terminal output. Features disk-based price caching, daily history tracking, threshold alerts and an optional scheduler for automated market-close reports.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors