Skip to content

Releases: TexasCoding/py-alpaca-api

v3.0.1: Complete API Coverage & Enhanced Features

21 Sep 02:28
f88c2e8

Choose a tag to compare

🎉 py-alpaca-api v3.0.1

🚀 Major Milestone: 100% Alpaca API Coverage!

We're thrilled to announce that py-alpaca-api now provides complete coverage of the Alpaca Trading and Market Data APIs!

📊 Coverage Stats

  • Trading API: 28/28 endpoints (100%)
  • Market Data API: 11/11 endpoints (100%)
  • Total Tests: 350+ unit and integration tests
  • Type Safety: Full mypy strict mode compliance

✨ New Features

📈 Market Data Endpoints

Historical Quotes

# Get bid/ask quotes with spread analysis
quotes = api.stock.quotes.get_historical_quotes(
    "AAPL",
    start="2024-01-01",
    end="2024-01-31"
)
# Automatic spread calculation included!

Auction Data

# Get opening and closing auction prices
auctions = api.stock.auctions.get_auctions(
    "AAPL",
    start="2024-01-01", 
    end="2024-01-31"
)

# Daily auction summaries
daily = api.stock.auctions.get_daily_auctions(
    ["AAPL", "MSFT"],
    start="2024-01-01",
    end="2024-01-31"
)

Latest Bars

# Get the most recent bar for symbols
bars = api.stock.history.get_latest_bars(
    ["AAPL", "MSFT", "GOOGL"]
)

Company Logos

# Multiple ways to get company logos
url = api.stock.logos.get_logo_url("AAPL")
data = api.stock.logos.get_logo("AAPL")
base64 = api.stock.logos.get_logo_base64("AAPL")
api.stock.logos.save_logo("AAPL", "logo.png")

# Batch operations
logos = api.stock.logos.get_multiple_logos(
    ["AAPL", "MSFT", "GOOGL"]
)

📊 Trading Enhancements

Get All Orders

# Retrieve all orders with advanced filtering
orders = api.trading.orders.get_all_orders(
    status="all",
    limit=100,
    after="2024-01-01",
    symbols=["AAPL", "MSFT"]
)

Close All Positions

# Close all positions at once
api.trading.positions.close_all(
    cancel_orders=True  # Also cancel pending orders
)

📚 Documentation

  • Complete API Reference: Every method documented with examples
  • User Guides: Practical tutorials for all modules
  • Type Hints: Full typing information for IDE support
  • Error Handling: Comprehensive exception documentation

🛠️ Improvements

  • Enhanced package metadata for better PyPI integration
  • Improved error messages and validation
  • Better pagination handling for large datasets
  • Automatic feed fallback (SIP → IEX → OTC)
  • Optimized batch operations for 200+ symbols

🔧 Bug Fixes

  • Fixed DataFrame type preservation in filtering operations
  • Resolved Union type issues in type checking
  • Corrected daily aggregation in auction data
  • Fixed binary data handling for logo endpoints

📦 Installation

pip install py-alpaca-api==3.0.1

🙏 Thank You

A huge thank you to all contributors and users who have helped make py-alpaca-api the most comprehensive Python wrapper for the Alpaca API!

📊 What's Next?

  • WebSocket support for real-time data streaming
  • Advanced portfolio analytics
  • Options trading support (when available)
  • Performance optimizations for large-scale operations

📖 Resources


Full Changelog: v3.0.0...v3.0.1

v3.0.0 - Complete Alpaca API Coverage

17 Sep 00:14
8719be8

Choose a tag to compare

🎉 py-alpaca-api v3.0.0

Major Release Highlights

This release brings complete coverage of Alpaca's stock trading API, significant performance improvements, and enhanced developer experience. With 27 new API endpoints and comprehensive testing, v3.0.0 represents a major milestone for the py-alpaca-api project.

✨ New Features

📊 Phase 1: Critical Missing Features

Corporate Actions API (#68)

  • Track dividends, stock splits, mergers, and spinoffs
  • Filter by symbol, type, and date range
  • Comprehensive data models for each action type
  • Full historical data access

Trade Data Support (#67)

  • Access historical trade data with pagination
  • Support for multiple data feeds (SIP, IEX, OTC)
  • Multi-symbol trade retrieval
  • Latest trade endpoint for real-time data

Market Snapshots (#69)

  • Complete market snapshot data in one call
  • Latest trade, quote, and bar data
  • Daily and previous daily bar information
  • Multi-symbol snapshot support

🚀 Phase 2: Important Enhancements

Account Configuration (#70)

  • Read current account configuration
  • Update trading settings programmatically
  • PDT protection settings
  • Trade confirmation emails
  • Margin multiplier configuration

Market Metadata (#71)

  • Access condition codes with descriptions
  • Exchange codes and mappings
  • Tape-specific condition lookups
  • Built-in caching for performance

Enhanced Order Management (#72)

  • Replace existing orders
  • Support for OTO (One-Triggers-Other) orders
  • Support for OCO (One-Cancels-Other) orders
  • Client order ID tracking
  • Improved order validation

⚡ Phase 3: Performance & Quality

Batch Operations (#73)

  • Multi-symbol data fetching with automatic batching
  • Handles 200+ symbols efficiently
  • Concurrent request processing
  • Optimized DataFrame operations
  • Memory-efficient data handling

Feed Management System (#74)

  • Automatic subscription level detection
  • Intelligent feed fallback (SIP → IEX → OTC)
  • Per-endpoint feed configuration
  • Failed feed caching to avoid retries
  • Clear logging for feed decisions

Caching System (#75)

  • LRU in-memory cache with size limits
  • Optional Redis backend support
  • Configurable TTL per data type
  • Pattern-based cache invalidation
  • Cache statistics and monitoring
  • Thread-safe concurrent access

📈 Statistics

  • 109+ Tests - Comprehensive unit and integration testing
  • 90%+ Coverage - High test coverage across all modules
  • 27 New Endpoints - Complete Alpaca stock API coverage
  • Full Type Safety - Complete type hints with mypy strict mode
  • 3 New Modules - cache/, http/feed_manager, and expanded stock/ modules

🔄 Backwards Compatibility

All existing v2.x functionality is preserved. New features are additive only, ensuring a smooth upgrade path for existing users.

📦 Installation

pip install py-alpaca-api==3.0.0

Or with uv:

uv add py-alpaca-api==3.0.0

📚 Documentation

Comprehensive documentation for all new features is available in the README, including:

  • Usage examples for every new API
  • Configuration guides
  • Performance optimization tips
  • Migration guide from v2.x

🎯 What's Next

  • v3.1.0 - WebSocket Streaming Support (Q2 2025)
  • v3.2.0 - Full Async/Await Support (Q3 2025)
  • v3.3.0 - Advanced Analytics (Q4 2025)
  • v4.0.0 - Options Trading Support (2026)

🙏 Acknowledgments

Thanks to all contributors and users who made this release possible. Special thanks to the Alpaca team for their excellent API and documentation.

💡 Upgrading from v2.x

# No breaking changes - just new features!
from py_alpaca_api import PyAlpacaAPI

# Existing code continues to work
alpaca = PyAlpacaAPI(api_key=KEY, api_secret=SECRET)

# New features are immediately available
snapshots = alpaca.stock.snapshots.get_snapshots(["AAPL", "GOOGL"])
config = alpaca.trading.account.get_configuration()
actions = alpaca.trading.corporate_actions.get_announcements("AAPL")

🐛 Bug Reports & Feature Requests

Please report any issues or request features on our GitHub Issues page.

📄 Full Changelog

See CHANGELOG.md for detailed changes.


Full Changelog: v2.2.0...v3.0.0

What's Changed

Full Changelog: v2.2.0...v3.0.0

v2.2.0 - Major Improvements and Modernization

15 Sep 00:39
e7c2643

Choose a tag to compare

🚀 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

v2.1.8

19 Jun 00:25
848b1b8

Choose a tag to compare

V2.1.8 (#59)

* update pypi

* tweaked news

v2.1.7

17 Jun 00:42
0ce0cd2

Choose a tag to compare

V2.1.7 (#58)

* update pypi

* adding tests

* added cache for yfinance, tweaked news and recommendations

* added cache for yfinance, tweaked news and recommendations

v1.0.3

04 Jun 23:29
3332df0

Choose a tag to compare

Added gain_ratio to predictor losers_to_gainers