# Portfolio Tracker CLI
A professional command-line tool for tracking your cryptocurrency and stock investments across multiple platforms with beautiful, real-time reporting.



## ✨ Features
- **📊 Real-time Portfolio Tracking**: Monitor your investments with live price data
- **🆔 Unique Transaction IDs**: Each transaction gets a unique identifier for easy management
- **💼 Multi-Platform Support**: Track investments across Binance, OKX, Coinbase, and Fidelity
- **📈 Beautiful Reports**: Rich, color-coded tables showing detailed portfolio analysis
- **🔄 Full CRUD Operations**: Add, view, edit, and delete transactions
- **🎨 Professional CLI**: Beautiful terminal output with Rich library
- **📱 Cross-Platform**: Works on macOS, Linux, and Windows
## 🚀 Quick Start
### Installation
```bash
# Install from PyPI
pip install portfolio-tracker-cli
# Or install from source
git clone https://github.com/yourusername/portfolio-tracker-cli.git
cd portfolio-tracker-cli
pip install -e .
```
### Basic Usage
```bash
# Add a crypto transaction
portfolio add --symbol BTCUSD --platform binance --amount 4000 --qty 0.05
# Add a stock transaction
portfolio add --symbol AAPL --platform fidelity --amount 1500 --qty 10
# View your portfolio report
portfolio report
# List all transactions
portfolio list
# Edit a transaction
portfolio edit --id abc12345 --symbol ETHUSD --amount 2000
# Delete a transaction
portfolio delete --id abc12345
```
## 📋 Commands
### `add` - Add New Transaction
Add a new investment transaction to your portfolio.
```bash
portfolio add --symbol <SYMBOL> --platform <PLATFORM> --amount <AMOUNT> --qty <QUANTITY>
```
**Arguments:**
- `--symbol`: Investment symbol (e.g., BTCUSD, ETHUSD, AAPL, QQQM)
- `--platform`: Trading platform (binance, okx, coinbase, fidelity)
- `--amount`: Amount spent in USD
- `--qty`: Quantity purchased
**Examples:**
```bash
# Buy Bitcoin on Binance
portfolio add --symbol BTCUSD --platform binance --amount 4000 --qty 0.05
# Buy Apple stock on Fidelity
portfolio add --symbol AAPL --platform fidelity --amount 1500 --qty 10
# Buy Ethereum on Coinbase
portfolio add --symbol ETHUSD --platform coinbase --amount 2000 --qty 0.1
```
### `report` - Generate Portfolio Report
Generate a comprehensive portfolio report with real-time prices and P&L calculations.
```bash
portfolio report
```
**Output includes:**
- 📊 Detailed breakdown by platform and symbol
- 📈 Symbol summary (cross-platform averages)
- 🏦 Asset class summary (crypto vs stocks)
- 💰 Real-time profit/loss calculations
- 🎨 Color-coded performance indicators
### `list` - List All Transactions
Display all transactions in a beautiful table format.
```bash
portfolio list
```
**Shows:**
- Transaction ID
- Date and time
- Symbol and platform
- Amount and quantity
- Asset class
### `edit` - Edit Transaction
Modify an existing transaction by its ID.
```bash
portfolio edit --id <TRANSACTION_ID> [--symbol <NEW_SYMBOL>] [--platform <NEW_PLATFORM>] [--amount <NEW_AMOUNT>] [--qty <NEW_QUANTITY>]
```
**Arguments:**
- `--id`: Transaction ID (required)
- `--symbol`: New symbol (optional)
- `--platform`: New platform (optional)
- `--amount`: New amount (optional)
- `--qty`: New quantity (optional)
**Example:**
```bash
# Change the amount of transaction abc12345
portfolio edit --id abc12345 --amount 2500
# Change symbol and platform
portfolio edit --id abc12345 --symbol ETHUSD --platform coinbase
```
### `delete` - Delete Transaction
Remove a transaction from your portfolio.
```bash
portfolio delete --id <TRANSACTION_ID> [--force]
```
**Arguments:**
- `--id`: Transaction ID (required)
- `--force`: Skip confirmation prompt (optional)
**Example:**
```bash
# Delete with confirmation
portfolio delete --id abc12345
# Delete without confirmation
portfolio delete --id abc12345 --force
```
## 🏦 Supported Platforms
| Platform | Type | Symbols | Description |
|----------|------|---------|-------------|
| **Binance** | Crypto | BTCUSD, ETHUSD, BNBUSD, etc. | Binance.US API |
| **OKX** | Crypto | BTC-USD, ETH-USD, etc. | OKX Exchange API |
| **Coinbase** | Crypto | BTC-USD, ETH-USD, etc. | Coinbase API |
| **Fidelity** | Stocks/ETFs | AAPL, QQQM, SPY, etc. | Via Stooq data |
## 📊 Data Storage
All portfolio data is stored locally in `portfolio_data.json` in your current directory. The file contains:
- Unique transaction IDs
- Transaction details (symbol, platform, amount, quantity)
- Timestamps
- Asset classification
**Example data structure:**
```json
{
"transactions": {
"abc12345": {
"id": "abc12345",
"symbol": "BTCUSD",
"platform": "binance",
"amount": 4000.0,
"qty": 0.05,
"timestamp": "2024-01-15T10:30:00",
"asset_class": "crypto"
}
},
"last_updated": "2024-01-15T10:30:00"
}
```
## 🎨 Beautiful Output
The CLI uses the Rich library to provide beautiful, color-coded output:
- **Green**: Positive P&L
- **Red**: Negative P&L
- **Cyan**: Headers and labels
- **Magenta**: Table headers
- **Blue**: Information panels
## 🔧 Configuration
The tool automatically creates necessary files in your current directory:
- `portfolio_data.json`: Your portfolio data
- `portfolio_config.json`: Configuration settings (future use)
## 🚀 Publishing to PyPI
To publish this tool to PyPI:
1. **Update setup_cli.py**:
- Change author information
- Update GitHub repository URL
- Modify package name if needed
2. **Build and upload**:
```bash
python setup_cli.py sdist bdist_wheel
twine upload dist/*
```
3. **Install globally**:
```bash
pip install portfolio-tracker-cli
```
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## 📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
## 🙏 Acknowledgments
- [Rich](https://github.com/Textualize/rich) for beautiful terminal output
- [Pandas](https://pandas.pydata.org/) for data manipulation
- [Requests](https://requests.readthedocs.io/) for API calls
## 📞 Support
If you encounter any issues or have questions:
1. Check the [GitHub Issues](https://github.com/yourusername/portfolio-tracker-cli/issues)
2. Create a new issue with detailed information
3. Include your operating system and Python version
---
**Happy Investing! 📈💰**
Raw data
{
"_id": null,
"home_page": "https://github.com/yangwl356/portfolio-tracker-cli",
"name": "portfolio-tracker-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "portfolio, crypto, stocks, investment, tracking, cli, finance",
"author": "Yangwl356",
"author_email": "yangwl356@proton.me",
"download_url": "https://files.pythonhosted.org/packages/83/f1/af90d5ce45203507a643b62d3d817b3426d92304bbfb12876a0d7533dc1a/portfolio-tracker-cli-1.0.0.tar.gz",
"platform": null,
"description": "# Portfolio Tracker CLI\n\nA professional command-line tool for tracking your cryptocurrency and stock investments across multiple platforms with beautiful, real-time reporting.\n\n\n\n\n\n## \u2728 Features\n\n- **\ud83d\udcca Real-time Portfolio Tracking**: Monitor your investments with live price data\n- **\ud83c\udd94 Unique Transaction IDs**: Each transaction gets a unique identifier for easy management\n- **\ud83d\udcbc Multi-Platform Support**: Track investments across Binance, OKX, Coinbase, and Fidelity\n- **\ud83d\udcc8 Beautiful Reports**: Rich, color-coded tables showing detailed portfolio analysis\n- **\ud83d\udd04 Full CRUD Operations**: Add, view, edit, and delete transactions\n- **\ud83c\udfa8 Professional CLI**: Beautiful terminal output with Rich library\n- **\ud83d\udcf1 Cross-Platform**: Works on macOS, Linux, and Windows\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\n# Install from PyPI\npip install portfolio-tracker-cli\n\n# Or install from source\ngit clone https://github.com/yourusername/portfolio-tracker-cli.git\ncd portfolio-tracker-cli\npip install -e .\n```\n\n### Basic Usage\n\n```bash\n# Add a crypto transaction\nportfolio add --symbol BTCUSD --platform binance --amount 4000 --qty 0.05\n\n# Add a stock transaction\nportfolio add --symbol AAPL --platform fidelity --amount 1500 --qty 10\n\n# View your portfolio report\nportfolio report\n\n# List all transactions\nportfolio list\n\n# Edit a transaction\nportfolio edit --id abc12345 --symbol ETHUSD --amount 2000\n\n# Delete a transaction\nportfolio delete --id abc12345\n```\n\n## \ud83d\udccb Commands\n\n### `add` - Add New Transaction\n\nAdd a new investment transaction to your portfolio.\n\n```bash\nportfolio add --symbol <SYMBOL> --platform <PLATFORM> --amount <AMOUNT> --qty <QUANTITY>\n```\n\n**Arguments:**\n- `--symbol`: Investment symbol (e.g., BTCUSD, ETHUSD, AAPL, QQQM)\n- `--platform`: Trading platform (binance, okx, coinbase, fidelity)\n- `--amount`: Amount spent in USD\n- `--qty`: Quantity purchased\n\n**Examples:**\n```bash\n# Buy Bitcoin on Binance\nportfolio add --symbol BTCUSD --platform binance --amount 4000 --qty 0.05\n\n# Buy Apple stock on Fidelity\nportfolio add --symbol AAPL --platform fidelity --amount 1500 --qty 10\n\n# Buy Ethereum on Coinbase\nportfolio add --symbol ETHUSD --platform coinbase --amount 2000 --qty 0.1\n```\n\n### `report` - Generate Portfolio Report\n\nGenerate a comprehensive portfolio report with real-time prices and P&L calculations.\n\n```bash\nportfolio report\n```\n\n**Output includes:**\n- \ud83d\udcca Detailed breakdown by platform and symbol\n- \ud83d\udcc8 Symbol summary (cross-platform averages)\n- \ud83c\udfe6 Asset class summary (crypto vs stocks)\n- \ud83d\udcb0 Real-time profit/loss calculations\n- \ud83c\udfa8 Color-coded performance indicators\n\n### `list` - List All Transactions\n\nDisplay all transactions in a beautiful table format.\n\n```bash\nportfolio list\n```\n\n**Shows:**\n- Transaction ID\n- Date and time\n- Symbol and platform\n- Amount and quantity\n- Asset class\n\n### `edit` - Edit Transaction\n\nModify an existing transaction by its ID.\n\n```bash\nportfolio edit --id <TRANSACTION_ID> [--symbol <NEW_SYMBOL>] [--platform <NEW_PLATFORM>] [--amount <NEW_AMOUNT>] [--qty <NEW_QUANTITY>]\n```\n\n**Arguments:**\n- `--id`: Transaction ID (required)\n- `--symbol`: New symbol (optional)\n- `--platform`: New platform (optional)\n- `--amount`: New amount (optional)\n- `--qty`: New quantity (optional)\n\n**Example:**\n```bash\n# Change the amount of transaction abc12345\nportfolio edit --id abc12345 --amount 2500\n\n# Change symbol and platform\nportfolio edit --id abc12345 --symbol ETHUSD --platform coinbase\n```\n\n### `delete` - Delete Transaction\n\nRemove a transaction from your portfolio.\n\n```bash\nportfolio delete --id <TRANSACTION_ID> [--force]\n```\n\n**Arguments:**\n- `--id`: Transaction ID (required)\n- `--force`: Skip confirmation prompt (optional)\n\n**Example:**\n```bash\n# Delete with confirmation\nportfolio delete --id abc12345\n\n# Delete without confirmation\nportfolio delete --id abc12345 --force\n```\n\n## \ud83c\udfe6 Supported Platforms\n\n| Platform | Type | Symbols | Description |\n|----------|------|---------|-------------|\n| **Binance** | Crypto | BTCUSD, ETHUSD, BNBUSD, etc. | Binance.US API |\n| **OKX** | Crypto | BTC-USD, ETH-USD, etc. | OKX Exchange API |\n| **Coinbase** | Crypto | BTC-USD, ETH-USD, etc. | Coinbase API |\n| **Fidelity** | Stocks/ETFs | AAPL, QQQM, SPY, etc. | Via Stooq data |\n\n## \ud83d\udcca Data Storage\n\nAll portfolio data is stored locally in `portfolio_data.json` in your current directory. The file contains:\n\n- Unique transaction IDs\n- Transaction details (symbol, platform, amount, quantity)\n- Timestamps\n- Asset classification\n\n**Example data structure:**\n```json\n{\n \"transactions\": {\n \"abc12345\": {\n \"id\": \"abc12345\",\n \"symbol\": \"BTCUSD\",\n \"platform\": \"binance\",\n \"amount\": 4000.0,\n \"qty\": 0.05,\n \"timestamp\": \"2024-01-15T10:30:00\",\n \"asset_class\": \"crypto\"\n }\n },\n \"last_updated\": \"2024-01-15T10:30:00\"\n}\n```\n\n## \ud83c\udfa8 Beautiful Output\n\nThe CLI uses the Rich library to provide beautiful, color-coded output:\n\n- **Green**: Positive P&L\n- **Red**: Negative P&L\n- **Cyan**: Headers and labels\n- **Magenta**: Table headers\n- **Blue**: Information panels\n\n## \ud83d\udd27 Configuration\n\nThe tool automatically creates necessary files in your current directory:\n\n- `portfolio_data.json`: Your portfolio data\n- `portfolio_config.json`: Configuration settings (future use)\n\n## \ud83d\ude80 Publishing to PyPI\n\nTo publish this tool to PyPI:\n\n1. **Update setup_cli.py**:\n - Change author information\n - Update GitHub repository URL\n - Modify package name if needed\n\n2. **Build and upload**:\n ```bash\n python setup_cli.py sdist bdist_wheel\n twine upload dist/*\n ```\n\n3. **Install globally**:\n ```bash\n pip install portfolio-tracker-cli\n ```\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- [Rich](https://github.com/Textualize/rich) for beautiful terminal output\n- [Pandas](https://pandas.pydata.org/) for data manipulation\n- [Requests](https://requests.readthedocs.io/) for API calls\n\n## \ud83d\udcde Support\n\nIf you encounter any issues or have questions:\n\n1. Check the [GitHub Issues](https://github.com/yourusername/portfolio-tracker-cli/issues)\n2. Create a new issue with detailed information\n3. Include your operating system and Python version\n\n---\n\n**Happy Investing! \ud83d\udcc8\ud83d\udcb0** \n",
"bugtrack_url": null,
"license": null,
"summary": "A professional command-line tool for tracking crypto and stock investments",
"version": "1.0.0",
"project_urls": {
"Bug Reports": "https://github.com/yangwl356/portfolio-tracker-cli/issues",
"Documentation": "https://github.com/yangwl356/portfolio-tracker-cli#readme",
"Homepage": "https://github.com/yangwl356/portfolio-tracker-cli",
"Source": "https://github.com/yangwl356/portfolio-tracker-cli"
},
"split_keywords": [
"portfolio",
" crypto",
" stocks",
" investment",
" tracking",
" cli",
" finance"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "10de8fcfb138a6bc17e05230be1e50153864820781d99654d3b8a2647359e63f",
"md5": "c04ed0c0ba4c75e8c4a18171e4a7e2ae",
"sha256": "b9647118bf1da8f45239cef88d8dbd5cc158152245e3e36d493832e7e9f448eb"
},
"downloads": -1,
"filename": "portfolio_tracker_cli-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c04ed0c0ba4c75e8c4a18171e4a7e2ae",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10218,
"upload_time": "2025-08-02T22:14:22",
"upload_time_iso_8601": "2025-08-02T22:14:22.823610Z",
"url": "https://files.pythonhosted.org/packages/10/de/8fcfb138a6bc17e05230be1e50153864820781d99654d3b8a2647359e63f/portfolio_tracker_cli-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "83f1af90d5ce45203507a643b62d3d817b3426d92304bbfb12876a0d7533dc1a",
"md5": "a74aebfca0d96374ca3320b20a021b95",
"sha256": "c378ac6db4b3979098348570af91b3ff535a0307cefd47253b16ef2b5b2a66c8"
},
"downloads": -1,
"filename": "portfolio-tracker-cli-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "a74aebfca0d96374ca3320b20a021b95",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 12218,
"upload_time": "2025-08-02T22:14:24",
"upload_time_iso_8601": "2025-08-02T22:14:24.195725Z",
"url": "https://files.pythonhosted.org/packages/83/f1/af90d5ce45203507a643b62d3d817b3426d92304bbfb12876a0d7533dc1a/portfolio-tracker-cli-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-02 22:14:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yangwl356",
"github_project": "portfolio-tracker-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "portfolio-tracker-cli"
}