How renankin/investment-analyser works
Investment Analyser is a local Flask app for managing investment portfolios across accounts. Users record accounts, assets, and transactions; the app can retrieve market histories, persist them locally, and present portfolio valuations, distributions, histories, and return analyses. Its analysis capabilities also include ETF search/comparison and dividend and split handling. The graph follows documented route-to-service responsibilities and indexed source references; some analysis and integration details are documented in the README but their implementation was not sampled, so those links are identified as documented rather than inferred from source.
Main entry points: repositories Data repositories · assets.py Asset routes · transaction_service.py Transaction ledger · price_service.py Price histories
Components 23
Web interface
- Account routes
app/routes/accounts.py - Asset routes
app/routes/assets.py - Transaction routes
app/routes/transactions.py - Portfolio dashboard
app/routes/homepage.py - Portfolio analysis routes
app/routes/portfolio_analysis.py - ETF analysis routes
app/routes/market_analysis.py - Portfolio views
app/templates
Portfolio domain
- Account management
app/services/account_service.py - Asset management
app/services/asset_service.py - Transaction ledger
app/services/transaction_service.py - Portfolio records
app/models/models.py - Price histories
app/services/price_service.py - Dividend histories
app/services/dividend_service.py - Stock split adjustment
app/services/stock_split_service.py
Persistence
- Data repositories
app/repositories - SQLite database
app/db/connection.py
Market data
- Yahoo market data
app/fetchers/yfinance.py - Tesouro Direto data
app/fetchers/tesouro_direto.py
Portfolio analysis
- Portfolio distribution
app/services/portfolio_distribution.py - Portfolio evolution
app/services/capital_evolution.py - Returns and IRR
app/services/roi.py - ETF search and comparison
app/services/etfs.py
Other components
- Investor
Connections 48
- Investor → Account routes: manages accounts
README.md - Investor → Asset routes: manages portfolio
README.md - Investor → Transaction routes: records trades
README.md - Investor → Portfolio dashboard: views dashboard
README.md - Investor → Portfolio analysis routes: analyzes returns
README.md - Investor → ETF analysis routes: compares ETFs
README.md - Account routes → Account management: calls
app/routes/accounts.py - Asset routes → Asset management: calls
app/routes/assets.py - Asset routes → Price histories: updates prices
app/routes/assets.py - Asset routes → Dividend histories: updates dividends
app/routes/assets.py - Asset routes → Stock split adjustment: updates splits
app/routes/assets.py - Asset routes → Transaction ledger: gets adjusted trades
app/routes/assets.py - Transaction routes → Transaction ledger: manages trades
app/routes/transactions.py - Portfolio dashboard → Portfolio distribution: gets allocation
app/routes/homepage.py - Portfolio analysis routes → Portfolio evolution: plots evolution
app/routes/portfolio_analysis.py - Portfolio analysis routes → Returns and IRR: calculates returns
app/routes/portfolio_analysis.py - ETF analysis routes → ETF search and comparison: searches and compares
app/routes/market_analysis.py - Account routes → Portfolio views: renders views
- Asset routes → Portfolio views: renders views
app/routes/assets.py - Transaction routes → Portfolio views: renders views
- Portfolio analysis routes → Portfolio views: renders views
- ETF analysis routes → Portfolio views: renders views
- Account management → Data repositories: reads and writes
app/services/account_service.py - Asset management → Data repositories: reads and writes
app/services/asset_service.py - Transaction ledger → Data repositories: reads and writes
app/services/transaction_service.py - Price histories → Data repositories: reads and writes prices
app/services/price_service.py - Dividend histories → Data repositories: reads and writes dividends
app/services/dividend_service.py - Stock split adjustment → Data repositories: reads and writes splits
app/services/stock_split_service.py - Data repositories → SQLite database: queries
app/repositories/transactions.py - Transaction ledger → Stock split adjustment: adjusts trades
app/services/transaction_service.py - Price histories → Yahoo market data: fetches prices
app/services/price_service.py - Price histories → Tesouro Direto data: fetches bond prices
app/services/price_service.py - Dividend histories → Yahoo market data: fetches dividends
app/services/dividend_service.py - Stock split adjustment → Yahoo market data: fetches splits
app/services/stock_split_service.py - Portfolio distribution → Yahoo market data: gets fund data
app/services/portfolio_distribution.py - ETF search and comparison → Yahoo market data: gets ETF data
app/services/etfs.py - Portfolio distribution → Data repositories: reads prices and trades
app/services/portfolio_distribution.py - Portfolio evolution → Data repositories: reads portfolio data
app/services/capital_evolution.py - Portfolio evolution → Transaction ledger: uses trade history
app/services/capital_evolution.py - Returns and IRR → Data repositories: reads prices and assets
app/services/roi.py - Returns and IRR → Dividend histories: includes dividends
app/services/roi.py - Returns and IRR → Transaction ledger: uses trade history
app/services/roi.py - ETF search and comparison → Data repositories: reads ETF assets
app/services/etfs.py - Account management → Portfolio records: uses records
app/services/account_service.py - Asset management → Portfolio records: uses records
app/services/asset_service.py - Transaction ledger → Portfolio records: uses records
app/services/transaction_service.py - Price histories → Portfolio records: uses records
app/services/price_service.py - Dividend histories → Portfolio records: uses records
app/services/dividend_service.py