Skip to content

Commit 8719be8

Browse files
TexasCodingclaude
andauthored
Release v3.0.0 - Complete Alpaca API Coverage (#76)
* feat: Initialize v3.0.0 development with comprehensive plan - Create DEVELOPMENT_PLAN.md with detailed roadmap for v3.0.0 - Add CHANGELOG.md to track version history - Create GitHub issue templates for feature tracking - Establish 4-phase development plan: * Phase 1: Critical missing features (Corporate Actions, Trade Data, Snapshots) * Phase 2: Important enhancements (Account Config, Market Metadata) * Phase 3: Performance improvements (Batch Ops, Caching, Feed Management) * Phase 4: Advanced features (WebSocket, Async support) - Set up branching strategy with v3.0.0 as base branch This provides a clear roadmap for achieving 100% Alpaca Stock API coverage Co-Authored-By: Claude <[email protected]> * Add claude GitHub actions 1757898251914 (#66) * "Claude PR Assistant workflow" * "Claude Code Review workflow" * feat: Add comprehensive Corporate Actions API support (#67) Implements Phase 1.1 of v3.0.0 development plan: - Create corporate_actions.py module with full API coverage - Add get_announcements() with date range and type filtering - Add get_announcement_by_id() for specific announcements - Support for dividends, splits, mergers, and spinoffs - Create specialized model classes for each action type - Add comprehensive unit tests (13 test cases) - Add live integration tests with real API calls - Update documentation with usage examples Key features: - Full type safety with dataclass models - Proper date validation (90-day limit) - Support for symbol and CUSIP filtering - Date type filtering (declaration, ex-date, record, payable) - Handles API response format (list or object) - Documents actual pagination behavior (returns all results) Tests: - All unit tests passing (13/13) - All integration tests passing (9/9) - Covers error handling, validation, and real API calls Co-authored-by: Claude <[email protected]> * Add comprehensive Trade Data API support (#68) Implements Phase 1.2 of the v3.0.0 development plan with full trade-level market data functionality. Features: - Historical trades retrieval with time range filtering - Latest trade data for single and multiple symbols - Automatic pagination support with get_all_trades() - Multi-symbol batch operations - Data feed selection (IEX, SIP, OTC) - As-of parameter for historical point-in-time data - RFC-3339 date validation and error handling Models: - TradeModel: Individual trade data with exchange, price, size, conditions - TradesResponse: Paginated response with next_page_token support - Full type safety with proper validation API Coverage: - GET /v2/stocks/{symbol}/trades - Historical trades - GET /v2/stocks/trades/latest - Latest trades - GET /v2/stocks/trades - Multi-symbol trades Tests: - 12 comprehensive unit tests with mocking - 10 integration tests for live API validation - Error handling and edge case coverage - Pagination and feed parameter validation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]> * feat: Add comprehensive Market Snapshots API support (#69) - Created snapshots.py module with get_snapshot() and get_snapshots() methods - Implemented SnapshotModel and BarModel dataclasses for snapshot data - Added support for latest trade, quote, minute bar, daily bar, and previous daily bar - Integrated snapshots into Stock module - Added comprehensive unit tests (15 test cases) - Added integration tests (10 test cases) - Supports multiple data feeds (iex, sip, otc) - Handles single and multiple symbol requests efficiently - Updated DEVELOPMENT_PLAN.md to mark feature as complete Completes Phase 1 (Critical Features) of v3.0.0 development * feat: Add Account Configuration API support (#70) - Implemented get_configuration() and update_configuration() methods in Account class - Created AccountConfigModel dataclass with all configuration fields - Added support for all account settings: dtbp_check, fractional_trading, max_margin_multiplier, no_shorting, pdt_check, ptp_no_exception_entry, suspend_trade, trade_confirm_email - Comprehensive validation for configuration parameters - Added 14 unit tests and 8 integration tests - Full type safety with mypy strict mode - Updated DEVELOPMENT_PLAN.md This completes the first feature of Phase 2 (Important Enhancements) * feat: Add Market Metadata API support (#71) - Created metadata.py module with exchange and condition code lookups - Implemented get_exchange_codes() for stock exchange mappings - Implemented get_condition_codes() with tape and ticktype support - Added get_all_condition_codes() for bulk retrieval - Added lookup methods for easy code-to-name resolution - Implemented intelligent caching with cache management - Added 16 unit tests and 11 integration tests - Full type safety with mypy strict mode - Updated DEVELOPMENT_PLAN.md Supports: - All stock exchange codes (NYSE, NASDAQ, IEX, etc.) - Trade condition codes for all tapes (A, B, C) - Quote condition codes for all tapes - Caching for improved performance - Cache clearing and management This completes the second feature of Phase 2 (Important Enhancements) * feat: Add Enhanced Order Management features (#72) - Implement replace_order() method for updating existing orders - Add client_order_id support to all order methods - Add order_class parameter for OTO/OCO/bracket orders - Enhance order validation logic - Add comprehensive tests (13 unit, 10 integration) - Update DEVELOPMENT_PLAN.md Note: Client order ID operations use order list filtering as Alpaca API removed direct :by_client_order_id endpoints 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]> * feat: Add batch operations for multi-symbol data fetching (#73) * feat: Add batch operations for multi-symbol data fetching - Update history.py to support multi-symbol bars with automatic batching for 200+ symbols - Update latest_quote.py to support batch quotes with automatic batching - Implement concurrent request handling using ThreadPoolExecutor - Add comprehensive tests (20 test cases: 11 unit, 9 integration) - Update README with batch operation examples and features - Optimize DataFrame operations for better performance - Maintain backward compatibility for single-symbol requests - Update DEVELOPMENT_PLAN.md to mark batch operations as complete * fix: Correct order validation logic and OCO test parameters - Remove overly strict validation in orders.py that required both take_profit AND stop_loss - Different order classes have different requirements: - Bracket orders need both take_profit and stop_loss - OTO orders need EITHER take_profit OR stop_loss - OCO orders are exit-only and have specific validation rules - Update OCO test to handle expected behavior (exit-only orders) - All order enhancement integration tests now passing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * feat: Add Feed Management System for automatic feed selection and fallback (#74) - Create comprehensive feed_manager.py module with smart feed handling - Implement automatic subscription level detection (Basic/Unlimited/Business) - Add intelligent feed fallback mechanism (SIP → IEX → OTC) - Support per-endpoint feed configuration - Track and cache failed feeds to avoid repeated failures - Add FeedConfig dataclass for customizable feed preferences - Implement 47 tests (36 unit, 11 integration) with 100% coverage - Fix timestamp comparison in trades test to handle different precision levels Features: - Auto-detects user's Alpaca subscription level - Automatically falls back to available feeds on permission errors - Configurable feed preferences with endpoint-specific overrides - Smart caching to avoid repeated failed requests - Clear logging for feed selection and fallback decisions This completes Phase 3.2 of the v3.0.0 development plan. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]> * feat: Add Caching System (Phase 3.3) (#75) * feat: Add comprehensive Caching System for performance optimization - Create cache/ module with LRU memory cache and optional Redis support - Implement CacheManager with configurable TTL per data type - Add cache invalidation by pattern and prefix clearing - Support for dataclass serialization and decorator-based caching - Implement cache statistics tracking (hit/miss rates) - Add 40 comprehensive tests (29 unit, 11 integration) - Configure sensible TTLs: 1 day for market hours, 1 hour for assets, etc. Features: - LRU in-memory cache with size limits - Optional Redis backend with automatic fallback - Per-data-type TTL configuration - Cache key generation with hash for long keys - Thread-safe concurrent access - Decorator for easy function result caching - Pattern-based cache invalidation - Detailed statistics tracking This completes Phase 3 of the v3.0.0 development plan. All Performance & Quality features are now implemented. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs: Update README.md with v3.0.0 features and bump version - Add comprehensive documentation for all v3.0.0 features - Document Market Snapshots API support - Document Account Configuration API support - Document Market Metadata API support - Document Enhanced Order Management features - Document Feed Management System - Document Caching System - Update project structure to reflect new modules - Update roadmap with completed v3.0.0 features - Defer Phase 4 features to v3.1.0 and v3.2.0 - Update version to 3.0.0 in pyproject.toml 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs: Clean up DEVELOPMENT_PLAN.md for future versions - Remove all completed v3.0.0 tasks - Reorganize for v3.1.0 (WebSocket) and v3.2.0 (Async) - Add summary of completed features - Update roadmap with future versions - Simplify structure for ongoing development 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent e7c2643 commit 8719be8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+9152
-71
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
name: v3.0.0 Feature Implementation
3+
about: Track implementation of a v3.0.0 feature
4+
title: '[v3.0.0] '
5+
labels: 'enhancement, v3.0.0'
6+
assignees: ''
7+
8+
---
9+
10+
## Feature Name
11+
<!-- e.g., Corporate Actions API -->
12+
13+
## Phase
14+
<!-- Phase 1/2/3/4 -->
15+
16+
## Branch Name
17+
<!-- e.g., feature/corporate-actions-api -->
18+
19+
## Description
20+
<!-- Brief description of the feature -->
21+
22+
## Implementation Checklist
23+
24+
### Code Implementation
25+
- [ ] Core functionality implemented
26+
- [ ] Data models created
27+
- [ ] Error handling added
28+
- [ ] Type hints complete
29+
- [ ] Docstrings written
30+
31+
### Testing
32+
- [ ] Unit tests written
33+
- [ ] Integration tests written
34+
- [ ] Mock tests for offline testing
35+
- [ ] Test coverage >90%
36+
- [ ] All tests passing
37+
38+
### Documentation
39+
- [ ] API documentation updated
40+
- [ ] Usage examples added
41+
- [ ] README updated if needed
42+
- [ ] CHANGELOG entry added
43+
44+
### Code Quality
45+
- [ ] Code formatted (make format)
46+
- [ ] Linting passing (make lint)
47+
- [ ] Type checking passing (make type-check)
48+
- [ ] Pre-commit hooks passing
49+
50+
## Acceptance Criteria
51+
<!-- List specific requirements that must be met -->
52+
- [ ]
53+
- [ ]
54+
- [ ]
55+
56+
## API Endpoints Covered
57+
<!-- List the Alpaca API endpoints this feature implements -->
58+
- `GET /v2/...`
59+
- `POST /v2/...`
60+
61+
## Related Issues/PRs
62+
<!-- Link to related issues or pull requests -->
63+
-
64+
65+
## Notes
66+
<!-- Any additional context or considerations -->
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: v3.0.0 Progress Update
3+
about: Weekly progress update for v3.0.0 development
4+
title: '[v3.0.0 Progress] Week of '
5+
labels: 'v3.0.0, progress'
6+
assignees: ''
7+
8+
---
9+
10+
## Week of [DATE]
11+
12+
## Completed This Week
13+
14+
### Features Completed
15+
- [ ] Feature name (PR #)
16+
- [ ] Feature name (PR #)
17+
18+
### Tests Added
19+
- Total new tests:
20+
- Current coverage:
21+
22+
### Documentation Updates
23+
- [ ] Updated feature docs
24+
- [ ] Added examples
25+
26+
## In Progress
27+
28+
### Currently Working On
29+
- Feature: [name] - [% complete]
30+
- Feature: [name] - [% complete]
31+
32+
### Blockers
33+
<!-- Any issues blocking progress -->
34+
-
35+
36+
## Next Week's Plan
37+
38+
### Features to Start
39+
- [ ] Feature name
40+
- [ ] Feature name
41+
42+
### Features to Complete
43+
- [ ] Feature name
44+
- [ ] Feature name
45+
46+
## Overall Progress
47+
48+
### Phase Status
49+
- **Phase 1**: [0]% Complete (Critical Features)
50+
- **Phase 2**: [0]% Complete (Important Enhancements)
51+
- **Phase 3**: [0]% Complete (Performance & Quality)
52+
- **Phase 4**: [0]% Complete (Advanced Features)
53+
54+
### Metrics
55+
- Total API Coverage: [X]%
56+
- Test Coverage: [X]%
57+
- Documentation Complete: [X]%
58+
59+
## Risk Assessment
60+
61+
### New Risks Identified
62+
-
63+
64+
### Mitigation Actions
65+
-
66+
67+
## Notes
68+
<!-- Any additional updates or context -->
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
prompt: |
40+
Please review this pull request and provide feedback on:
41+
- Code quality and best practices
42+
- Potential bugs or issues
43+
- Performance considerations
44+
- Security concerns
45+
- Test coverage
46+
47+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
48+
49+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
50+
51+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
52+
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
53+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
54+

.github/workflows/claude.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
actions: read # Required for Claude to read CI results on PRs
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@v1
36+
with:
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
39+
# This is an optional setting that allows Claude to read CI results on PRs
40+
additional_permissions: |
41+
actions: read
42+
43+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44+
# prompt: 'Update the pull request description to include a summary of changes.'
45+
46+
# Optional: Add claude_args to customize behavior and configuration
47+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48+
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
49+
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
50+

CHANGELOG.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Changelog
2+
3+
All notable changes to py-alpaca-api will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [3.0.0] - Unreleased
9+
10+
### Overview
11+
Major release adding complete Alpaca Stock API coverage, performance improvements, and real-time data support.
12+
13+
### Added
14+
- 📋 Comprehensive development plan (DEVELOPMENT_PLAN.md)
15+
- 🏗️ New v3.0.0 branch structure for organized development
16+
17+
### Planned Features (In Development)
18+
#### Phase 1: Critical Missing Features
19+
- [ ] Corporate Actions API - Track dividends, splits, mergers
20+
- [ ] Trade Data Support - Access to individual trade data
21+
- [ ] Market Snapshots - Current market overview for symbols
22+
23+
#### Phase 2: Important Enhancements
24+
- [ ] Account Configuration Management
25+
- [ ] Enhanced Order Management (replace, extended hours)
26+
- [ ] Market Metadata (condition codes, exchange codes)
27+
28+
#### Phase 3: Performance & Quality
29+
- [ ] Batch Operations for multiple symbols
30+
- [ ] Feed Management System (IEX/SIP/OTC)
31+
- [ ] Caching System with configurable TTL
32+
33+
#### Phase 4: Advanced Features
34+
- [ ] WebSocket Streaming Support
35+
- [ ] Async/Await Implementation
36+
37+
### Changed
38+
- Restructured project for v3.0.0 development
39+
40+
### Deprecated
41+
- None
42+
43+
### Removed
44+
- None
45+
46+
### Fixed
47+
- None
48+
49+
### Security
50+
- None
51+
52+
## [2.2.0] - 2024-12-15
53+
54+
### Added
55+
- Stock analysis tools with ML predictions
56+
- Market screener for gainers/losers
57+
- News aggregation from multiple sources
58+
- Sentiment analysis for stocks
59+
- Prophet integration for price forecasting
60+
61+
### Changed
62+
- Improved error handling across all modules
63+
- Enhanced DataFrame operations
64+
- Better type safety with mypy strict mode
65+
66+
### Fixed
67+
- Yahoo Finance news fetching reliability
68+
- DataFrame type preservation issues
69+
- Prophet seasonality parameter handling
70+
71+
## [2.1.0] - 2024-11-01
72+
73+
### Added
74+
- Watchlist management functionality
75+
- Portfolio history tracking
76+
- Market calendar support
77+
- Extended order types (bracket, trailing stop)
78+
79+
### Changed
80+
- Improved pagination for large datasets
81+
- Better rate limit handling
82+
83+
### Fixed
84+
- Order validation for fractional shares
85+
- Timezone handling in market hours
86+
87+
## [2.0.0] - 2024-09-15
88+
89+
### Added
90+
- Complete rewrite with modular architecture
91+
- Full type hints and mypy support
92+
- Comprehensive test suite (109+ tests)
93+
- Separate trading and stock modules
94+
95+
### Changed
96+
- Breaking: New API structure with PyAlpacaAPI class
97+
- Breaking: All methods now return typed dataclasses
98+
- Improved error handling with custom exceptions
99+
100+
### Removed
101+
- Legacy API methods
102+
- Deprecated authentication methods
103+
104+
## [1.0.0] - 2024-06-01
105+
106+
### Added
107+
- Initial release
108+
- Basic trading operations
109+
- Market data retrieval
110+
- Account management
111+
112+
---
113+
114+
*For detailed migration guides between versions, see [MIGRATION.md](MIGRATION.md)*

0 commit comments

Comments
 (0)