Skip to main content

A comprehensive toolkit for portfolio analysis and management

Project description

en es

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.2.0.tar.gz (110.8 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.2.0-py3-none-any.whl (89.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: portfolio_toolkit-0.2.0.tar.gz
  • Upload date:
  • Size: 110.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 54a92755e3c638d0d4c6a792b99ec4b5f491053cf719938f05bca645451c00bd
MD5 9afc00dc818b4cd1a663b1bbe85e2990
BLAKE2b-256 bdcfc0be532859ea93c0a82f9cc452d6e3ffa3d783d310a644be87e95e3592d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for portfolio_toolkit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ca5fde074b39938dff4d6778032c401bc439b4b598cfff71106472fa4ff0924
MD5 7f747cdcae2fff2c7289d9c48ecb1c9b
BLAKE2b-256 ebbe7f03022c05d77f600cf0c218e97813eb9ad96d4fea18f467791717ba9ed0

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