Skip to main content

A comprehensive toolkit for portfolio analysis and management

Project description

Portfolio-tools Library Documentation

Documentation Tests Python

This library provides tools for financial analysis, portfolio management, and market data visualization with comprehensive multi-currency support and FIFO cost calculation.

📚 Documentation

📖 Full Documentation - Complete API reference, user guides, and examples

Quick Documentation Links

Building Documentation Locally

# Install documentation dependencies
pip install sphinx sphinx-rtd-theme

# Build documentation
./manage_docs.sh build

# Serve documentation locally
./manage_docs.sh serve

# Auto-rebuild on changes
./manage_docs.sh watch

Code Quality

This project maintains high code quality standards using:

  • Black - Code formatting
  • isort - Import sorting
  • flake8 - Linting
  • pytest - Testing

Quick Quality Checks

# Run all quality checks
./check_quality.sh

# Auto-format code
./format_code.sh

# Individual tools
black portfolio_toolkit/      # Format code
isort portfolio_toolkit/      # Sort imports
flake8 portfolio_toolkit/     # Lint code
pytest tests/              # Run tests

Configuration

Code quality tools are configured in pyproject.toml and setup.cfg:

  • Line length: 88 characters
  • Black and isort profiles: compatible
  • flake8 ignores: E203, E501, W503

Installation

Install from the project root (local development):

pip install .

Or in editable mode (recommended for development):

pip install -e .

To uninstall:

pip uninstall portfolio-toolkit

Testing

Running Tests

# Run all tests and checks
./run_tests.sh

# Run specific test suites
./run_tests.sh unit         # Unit tests only
./run_tests.sh coverage     # Tests with coverage report
./run_tests.sh examples     # Validate example portfolios
./run_tests.sh cli          # Test CLI commands
./run_tests.sh lint         # Code quality checks

Manual Testing

# Run unit tests directly
python -m pytest tests/ -v

# Validate example portfolios
python tests/validate_examples.py

# Test CLI commands
portfolio-tools print-positions -f tests/examples/basic_portfolio.json

# Or using the module directly
python -m portfolio_toolkit.cli.cli portfolio print performance-summary tests/examples/basic_portfolio.json

Documentation

# Local development
./manage_docs.sh build      # Build documentation
./manage_docs.sh serve      # Serve locally
./manage_docs.sh watch      # Auto-rebuild on changes

# Deploy
./manage_docs.sh deploy     # Deploy to GitHub Pages

To Do

  • Add unit and integration tests for all modules
  • Document all public methods with usage examples
  • Support multi-currency portfolios and automatic currency conversion
  • Add support for more data providers (e.g., Alpha Vantage, IEX Cloud)
  • Allow loading portfolios from Excel and ODS files natively
  • Implement portfolio performance metrics (Sharpe, Sortino, drawdown, etc.)
  • Add interactive visualizations (e.g., with Plotly or Dash)
  • Document all public methods with usage examples
  • Add export to PDF/Excel reports
  • Allow portfolio rebalancing and optimization simulations
  • Add risk analysis and Value at Risk (VaR)
  • Improve CLI interface for task automation (migrated to Click framework)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

portfolio_toolkit-0.1.3.tar.gz (81.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

portfolio_toolkit-0.1.3-py3-none-any.whl (80.2 kB view details)

Uploaded Python 3

File details

Details for the file portfolio_toolkit-0.1.3.tar.gz.

File metadata

  • Download URL: portfolio_toolkit-0.1.3.tar.gz
  • Upload date:
  • Size: 81.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for portfolio_toolkit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 62d545f928776e856617b46bc47936b8c13b800f0c38b74179c1a66925fbd615
MD5 8387fd1de1469baac0e5e756ed271be3
BLAKE2b-256 459443be740d97bb73552b79361281ae867dceb46d11e954d909005500b5f794

See more details on using hashes here.

File details

Details for the file portfolio_toolkit-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for portfolio_toolkit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0aeac431a5393043ac72de4b16c41c763b6e5592e5449527ed2773e84f86c662
MD5 7ed657f02c9417a2af002cc0276fec9a
BLAKE2b-256 e1a5df9510148ac7638db9550a09425f68de2324465c1b4d9539eff3c2ba6823

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page