Skip to content

v2.2.0 - Major Improvements and Modernization

Choose a tag to compare

@TexasCoding TexasCoding released this 15 Sep 00:39
· 10 commits to main since this release
e7c2643

🚀 py-alpaca-api v2.2.0

This major release brings comprehensive improvements to the py-alpaca-api project with professional tooling, complete test coverage, and modern Python development practices.

✨ Highlights

  • All tests passing (109/109) ✅
  • Zero type errors with mypy strict mode
  • Professional development tooling configured
  • Comprehensive documentation rewrite
  • Full backward compatibility maintained

🔧 Test Fixes

Fixed Test Failures

  • Fixed ValidationError vs ValueError in order validation tests
  • Fixed 'canceled' vs 'cancelled' spelling inconsistencies in API responses
  • Fixed portfolio_history column mismatch (API returns 7 columns vs expected 5)
  • Updated model tests to match actual behavior (no KeyError on missing fields)
  • Fixed DatetimeIndex type issues in account.py

📊 Type System Improvements

Enhanced Type Safety

  • Added comprehensive type annotations throughout the codebase
  • Created custom exception hierarchy:
    • PyAlpacaAPIError (base exception)
    • AuthenticationError for auth failures
    • APIRequestError for API errors
    • ValidationError for input validation
  • Fixed all mypy type checking errors (0 errors remaining)
  • Added proper type guards for DataFrame operations
  • Fixed implicit optional parameters (PEP 484 compliance)

🛠️ Development Tooling

Professional Setup

  • Ruff: Configured for linting and formatting (88 char line length)
  • MyPy: Static type checking with strict settings
  • Pre-commit: Automated code quality checks on every commit
  • Makefile: Common development tasks automation
  • pytest: Enhanced configuration with coverage reporting
  • CI/CD: GitHub Actions workflow with sequential test execution

CI/CD Improvements

  • Fixed GitHub Actions workflows to use correct setup-uv version
  • Configured sequential test execution to avoid API rate limits
  • Added delay between test runs for rate limit management
  • All CI checks now passing (lint, build, tests for Python 3.10/3.11/3.12)

📚 Documentation

README.md - Complete Rewrite

  • Modern, professional design with badges
  • Comprehensive code examples for all features
  • Clear installation instructions for pip and uv
  • Development guidelines and best practices
  • Project roadmap and disclaimer sections
  • Quick start guide with real-world examples

CLAUDE.md - AI Assistant Guidance

  • Detailed architecture documentation
  • Common issues and solutions
  • Testing guidelines and patterns
  • CI/CD pipeline documentation
  • Best practices for contributors
  • Tips specifically for AI assistants

CONTRIBUTING.md

  • Development workflow guidelines
  • Code style requirements
  • Testing requirements
  • Pull request process

🧹 Code Quality Improvements

Bug Fixes

  • Fixed Prophet seasonality parameters (boolean to "auto" string)
  • Improved DataFrame type safety with explicit assertions
  • Enhanced error handling with specific exception types
  • Fixed pandas deprecation warnings
  • Improved code organization and consistency

Repository Cleanup

  • Removed obsolete .grok/settings.json
  • Removed GEMINI.md (replaced by CLAUDE.md)
  • Updated .gitignore with comprehensive patterns

📦 Dependencies

Core Dependencies

  • pandas >= 2.2.3
  • numpy >= 2.1.1
  • requests >= 2.32.3
  • pendulum >= 3.0.0
  • prophet >= 1.1.5
  • yfinance >= 0.2.43
  • beautifulsoup4 >= 4.12.3

Development Dependencies

  • pytest >= 8.3.3
  • ruff >= 0.6.8
  • mypy >= 1.11.0
  • pre-commit >= 3.8.0
  • hypothesis >= 6.112.1

🧪 Test Coverage

All 109 tests passing with comprehensive coverage:

  • Trading operations (orders, positions, accounts)
  • Market data retrieval
  • Stock screening and analysis
  • Model transformations
  • HTTP request handling
  • Error handling scenarios

🔄 Migration Guide

This release maintains full backward compatibility. No breaking changes were introduced. Users can upgrade directly from any previous version.

📈 Performance

  • Optimized DataFrame operations for better memory usage
  • Improved HTTP retry logic for resilient API communication
  • Better caching strategies for repeated requests

🙏 Acknowledgments

Special thanks to all contributors and users who helped identify issues and improve the codebase. This release represents a significant step forward in code quality and developer experience.

📦 Installation

# Using pip
pip install py-alpaca-api==2.2.0

# Using uv
uv add py-alpaca-api==2.2.0

🐛 Bug Reports

Please report any issues at: https://github.com/TexasCoding/py-alpaca-api/issues

📄 Full Changelog

View the complete list of changes in PR #65


Note: This release requires Python 3.10 or higher.

🤖 Generated with Claude Code