A collection of Python utilities and examples for stock analysis and music file management.
- Portfolio Tracking: Monitor and analyze investment portfolios with support for multiple funds (WCM, Coatue, etc.)
- Performance Visualization: Generate performance charts and comparisons against benchmarks
- Data Integration: Fetch real-time and historical stock data using yfinance and efinance
- Position Analysis: Calculate position sizes, weights, and performance metrics
stock/13f/: 13F portfolio analysis tools for institutional investorsbase_portfolio.py: Core portfolio analysis functionalitywcm_portfolio.py: WCM Investment Management portfolio implementationcoatue_portfolio.py: Coatue Management portfolio implementationviking_portfolio.py: Viking portfolio implementationthree_lines/: Generated trend charts (PNG)
stock/tiger/: Trading strategies and position management- Individual stock analysis (AMD, NVDA, UVXY, etc.)
- Real-time cash and position tracking
Run a portfolio analysis from CLI:
python stock/13f/wcm_portfolio.py 2025-01-01 2025-12-31
python stock/13f/coatue_portfolio.py 2025-01-01 2025-12-31
python stock/13f/viking_portfolio.py 2025-01-01 2025-12-31Trend charts will be saved to:
stock/13f/three_lines/${FUND_NAME}_${start_date}_${end_date}.png
Notes:
- Default cash behavior:
BasePortfolio.NORMALIZE_WEIGHTS = Falseby default. If yourRAW_WEIGHTSsum to< 1.0, the remaining1 - sum(weights)is treated as cash. - Aggressive mode: set
NORMALIZE_WEIGHTS = Truein a portfolio class to fully invest (normalize weights to sum to 1). - IPO handling: missing price history (e.g., IPO mid-year) is treated as cash (0 return) before the first available price.
Example output (WCM):
- FLAC File Organization: Clean and organize FLAC music files
- Tag Deduplication: Remove duplicate tags from audio files
- Metadata Normalization: Standardize music metadata for better library management
music/normalize_flac_by_dedup_tags.py: Main script for processing FLAC files- Shell scripts for batch processing in
music/sh/
# Normalize FLAC files in a directory
python music/normalize_flac_by_dedup_tags.py /path/to/music- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- For music processing, install required system tools:
# On macOS brew install flac
- Core: Python 3.11+
- See
requirements.txtfor Python package dependencies
Feel free to submit issues and enhancement requests or contribute code via pull requests.
