Skip to content

Commit 914adaf

Browse files
authored
Merge pull request #17 from TexasCoding/refactor_monolith_files
refactor: Major architecture refactoring - Convert monolithic modules to multi-file packages (v2.0.4)
2 parents 637a52b + 219ac76 commit 914adaf

Some content is hidden

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

64 files changed

+10336
-9525
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Old implementations are removed when improved
1414
- Clean, modern code architecture is prioritized
1515

16+
## [2.0.4] - 2025-08-02
17+
18+
### Changed
19+
- **🏗️ Major Architecture Refactoring**: Converted all large monolithic modules into multi-file packages
20+
- **client.py**`client/` package (8 specialized modules)
21+
- `rate_limiter.py`: Async rate limiting functionality
22+
- `auth.py`: Authentication and token management
23+
- `http.py`: HTTP client and request handling
24+
- `cache.py`: Intelligent caching for instruments and market data
25+
- `market_data.py`: Market data operations (instruments, bars)
26+
- `trading.py`: Trading operations (positions, trades)
27+
- `base.py`: Base class combining all mixins
28+
- `__init__.py`: Main ProjectX class export
29+
- **order_manager.py**`order_manager/` package (10 modules)
30+
- **position_manager.py**`position_manager/` package (12 modules)
31+
- **realtime_data_manager.py**`realtime_data_manager/` package (9 modules)
32+
- **realtime.py**`realtime/` package (8 modules)
33+
- **utils.py**`utils/` package (10 modules)
34+
35+
### Improved
36+
- **📁 Code Organization**: Separated concerns into logical modules for better maintainability
37+
- **🚀 Developer Experience**: Easier navigation and understanding of codebase structure
38+
- **✅ Testing**: Improved testability with smaller, focused modules
39+
- **🔧 Maintainability**: Each module now has a single, clear responsibility
40+
41+
### Technical Details
42+
- **Backward Compatibility**: All existing imports continue to work without changes
43+
- **No API Changes**: Public interfaces remain identical
44+
- **Import Optimization**: Reduced circular dependency risks
45+
- **Memory Efficiency**: Better module loading with focused imports
46+
1647
## [2.0.2] - 2025-08-02
1748

1849
### Added

CONTRIBUTING.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,37 @@ Good documentation is essential for this project:
174174
## Architecture Guidelines
175175

176176
### Project Structure
177-
- Maintain the existing modular architecture
178-
- Place new files in appropriate modules
179-
- Consider impacts on existing components
177+
178+
The SDK uses a modular architecture where large components are split into multi-file packages:
179+
180+
- **Client Module** (`client/`): Core async client functionality
181+
- `auth.py`: Authentication and token management
182+
- `http.py`: HTTP client and request handling
183+
- `cache.py`: Caching for instruments and market data
184+
- `market_data.py`: Market data operations
185+
- `trading.py`: Trading operations
186+
- `base.py`: Base class combining mixins
187+
188+
- **Trading Modules**:
189+
- `order_manager/`: Order lifecycle management (10 modules)
190+
- `position_manager/`: Portfolio and risk management (12 modules)
191+
192+
- **Real-time Modules**:
193+
- `realtime/`: WebSocket client functionality (8 modules)
194+
- `realtime_data_manager/`: Real-time OHLCV data (9 modules)
195+
196+
- **Utilities** (`utils/`): Shared utilities (10 modules)
197+
- Trading calculations, portfolio analytics, pattern detection
198+
- Market microstructure, formatting, environment handling
199+
200+
- **Indicators** (`indicators/`): 58+ technical indicators
201+
- Organized by category (momentum, overlap, volatility, etc.)
202+
203+
### Adding New Features
204+
- Place new functionality in the appropriate existing module
205+
- For large features, consider creating a new sub-module
206+
- Maintain backward compatibility for all public APIs
207+
- Follow the established mixin pattern for client extensions
180208

181209
### Performance Considerations
182210
- Implement time window filtering for analysis methods

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
project = "project-x-py"
2424
copyright = "2025, Jeff West"
2525
author = "Jeff West"
26-
release = "2.0.3"
27-
version = "2.0.3"
26+
release = "2.0.4"
27+
version = "2.0.4"
2828

2929
# -- General configuration ---------------------------------------------------
3030

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "project-x-py"
3-
version = "2.0.3"
3+
version = "2.0.4"
44
description = "High-performance Python SDK for futures trading with real-time WebSocket data, technical indicators, order management, and market depth analysis"
55
readme = "README.md"
66
license = { text = "MIT" }

src/project_x_py/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from typing import Any
2525

26-
__version__ = "2.0.3"
26+
__version__ = "2.0.4"
2727
__author__ = "TexasCoding"
2828

2929
# Core client classes - renamed from Async* to standard names

0 commit comments

Comments
 (0)