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.5.tar.gz (88.5 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.5-py3-none-any.whl (89.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: portfolio_toolkit-0.1.5.tar.gz
  • Upload date:
  • Size: 88.5 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.5.tar.gz
Algorithm Hash digest
SHA256 d13dc5b2b9ba3631498fc82669a2bb8984017cfe9e7928c51c4907c41b14082c
MD5 0fdffcc2d42922fbfbf022bd7280cb47
BLAKE2b-256 c0a56975c9fa3939bb066b867e3b1c5bb017823668b407b3840dddf0920f0efa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for portfolio_toolkit-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 469c5210cbbacd79a98b8ea569b10d83b07719ac32ea960b2ca469d785f1b4ae
MD5 06ff7b4e61e8260666c941498ef688bc
BLAKE2b-256 545e463ffe4f1d0f205e5b5133808e0b4fe1da0c09da01844e0284c6267e6e18

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