# Installation Guide This guide will help you install and configure TechKit on different platforms. Choose the appropriate installation method based on your use case. ## Python Installation ### Basic Installation The Python version is the most commonly used version of TechKit, especially suitable for data analysis and research scenarios. ```bash pip install techkit ``` ### System Requirements - **Python Version**: 3.10 or higher - **Dependencies**: NumPy 1.21 or higher (installed automatically) - **Operating Systems**: - Linux (x86_64, aarch64) - macOS (x86_64, arm64) - Windows (AMD64) ### Verify Installation After installation, you can verify it as follows: ```python import techkit as tk import numpy as np # Test basic functionality sma = tk.SMA(period=20) prices = np.array([100.0, 101.0, 102.0, 103.0, 104.0]) result = sma.calculate(prices) print("Installation successful! TechKit version:", tk.__version__) print("SMA calculation result:", result) ``` ### Common Issues **Q: Compilation errors during installation?** A: TechKit Python package provides pre-compiled binary packages (wheels), so compilation is usually not required. If you encounter issues: - Ensure Python version >= 3.10 - Ensure pip is up to date: `pip install --upgrade pip` - Try using `pip install techkit --no-cache-dir` **Q: How to upgrade to the latest version?** A: `pip install --upgrade techkit` **Q: Does it support Python 3.9?** A: No. TechKit requires Python 3.10+ features. ## JavaScript / Node.js Installation TechKit provides two Node.js packages. Choose based on your needs: ### techkit (Core Edition) - Recommended for Most Users ```bash npm install techkit # or yarn add techkit # or pnpm add techkit ``` **Features**: - Includes 158+ core indicators (TA-Lib compatible) - Small size (WASM ~200KB) - Supports Node.js and browsers - Automatically selects optimal backend (Native or WASM) **Use Cases**: Most applications requiring common technical indicators ### techkit-full (Full Edition) - For Complete Functionality ```bash npm install techkit-full # or yarn add techkit-full # or pnpm add techkit-full ``` **Features**: - Includes all 189 indicators - Includes advanced analytics (risk metrics, volatility models, pattern recognition) - Larger size (WASM ~800KB) - Supports Node.js and browsers **Use Cases**: Requiring complete functionality, advanced analytics, pattern recognition ### Version Comparison | Feature | techkit | techkit-full | |---------|---------|--------------| | Core Indicators | ✅ 158 | ✅ 158 | | Advanced Analytics | ❌ | ✅ 31 | | Risk Metrics | ❌ | ✅ Yes | | Volatility Models | ❌ | ✅ Yes | | Pattern Recognition | ❌ | ✅ Yes | | WASM Size | ~200KB | ~800KB | | Recommended For | Most applications | Complete functionality needs | ### Backend Selection TechKit Node.js packages automatically select the optimal backend: 1. **Native Backend** (Faster): - Automatically used on supported platforms - Requires platform-specific binary packages (installed automatically) - Best performance 2. **WASM Backend** (Universal): - Available on all platforms - Automatic fallback if Native is unavailable - Good performance, slightly larger size ### Verify Installation ```javascript import { init, SMA, getBackend } from 'techkit'; // Initialize (must be called before use) await init(); // Check which backend is being used console.log('Current backend:', getBackend()); // 'native' or 'wasm' // Test basic functionality const sma = new SMA(20); const result = sma.update(100.5); if (result.valid) { console.log('Installation successful! SMA value:', result.value); } // Cleanup resources sma.dispose(); ``` ### System Requirements - **Node.js**: 16.0 or higher - **Supported Platforms**: - Linux (x86_64) - macOS (x86_64, arm64) - Windows (AMD64) ## Browser / CDN Installation TechKit can be used directly in browsers without build tools: ### Using CDN (Recommended) ```html TechKit Browser Demo ``` ### Using npm Package (with Build Tools) If you're using build tools like Webpack, Vite, Rollup, etc.: ```bash npm install techkit ``` Then in your code: ```javascript import { init, SMA, RSI } from 'techkit'; await init(); // ... use code ``` ### Browser Compatibility - Chrome/Edge: Supported - Firefox: Supported - Safari: Supported (requires newer version) - Mobile Browsers: Supported ## C++ Installation ### As Git Submodule (Recommended) If you're using Git in your project: ```bash # Add TechKit as a submodule to your project git submodule add https://github.com/yiivon/techkit.git libs/techkit ``` Then in `CMakeLists.txt`: ```cmake # Add TechKit subdirectory add_subdirectory(libs/techkit) # Link to your target target_link_libraries(your_app PRIVATE techkit::static) # Or use shared library target_link_libraries(your_app PRIVATE techkit::shared) ``` ### Using find_package If TechKit is already installed on your system: ```cmake find_package(TechKit REQUIRED) target_link_libraries(your_app PRIVATE TechKit::techkit) ``` ### Building from Source ```bash # Clone repository git clone https://github.com/yiivon/techkit.git cd techkit # Create build directory mkdir build && cd build # Configure CMake cmake .. -DCMAKE_BUILD_TYPE=Release # Build cmake --build . # Install (optional) cmake --install . --prefix /usr/local ``` ### Build Options | Option | Default | Description | |--------|---------|-------------| | `TECHKIT_BUILD_SHARED` | ON | Build shared library (.so/.dll/.dylib) | | `TECHKIT_BUILD_STATIC` | ON | Build static library (.a/.lib) | | `TECHKIT_BUILD_TESTS` | ON | Build unit tests | | `TECHKIT_BUILD_PYTHON` | OFF | Build Python bindings | | `TECHKIT_BUILD_WASM` | OFF | Build WebAssembly | ### Example: Custom Build ```bash cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DTECHKIT_BUILD_SHARED=ON \ -DTECHKIT_BUILD_STATIC=OFF \ -DTECHKIT_BUILD_TESTS=OFF ``` ## Installation Verification Checklist After installation, we recommend verifying the following: - [ ] Successfully import the library - [ ] Create indicator instances - [ ] Calculate basic indicators (e.g., SMA) - [ ] Results meet expectations If you encounter issues, please check [GitHub Issues](https://github.com/yiivon/techkit/issues) or submit a new issue.