High-performance temporal feature engineering library implemented in Rust
npm install temporal_featuresA high-performance library for temporal feature engineering, implemented in Rust with bindings for Python and JavaScript/Node.js.
> Note: This project currently contains a placeholder implementation (add function). Future versions will include comprehensive temporal feature engineering capabilities.
- Single Source of Truth: Core logic written once in Rust
- Dual Language Support: Available for both Python and JavaScript/Node.js
- High Performance: Leverages Rust's speed and safety
- Cross-Platform: Works on macOS, Linux, and Windows
``bash`
npm install temporal_features
`bash`
pip install temporal_features
`python
from temporal_features import TemporalFeatures
$3
`javascript
const { TemporalFeatures } = require('temporal_features');// Create an instance
const tf = new TemporalFeatures();
// Use the add function (placeholder implementation)
const result = tf.add(5, 3);
console.log(
5 + 3 = ${result}); // Output: 5 + 3 = 8
`š ļø Development
$3
- Rust (latest stable version)
- Python 3.8+ (for Python bindings)
- Node.js 10+ (for JavaScript bindings)
- maturin (for Python builds)
- @napi-rs/cli (for Node.js builds)
$3
#### Python
`bash
Install maturin
pip install maturinBuild and install in development mode
maturin develop --features python
`#### JavaScript/Node.js
`bash
Install dependencies
npm installBuild the native module
npm run build
`$3
`bash
Rust tests
cargo testPython tests (after building)
python -m pytestJavaScript tests
npm test
`š Architecture
This project uses a single source of truth pattern:
`
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Core Logic (Rust) ā
ā src/lib.rs ā
ā - TemporalFeaturesCore ā
ā - Pure business logic ā
āāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāā“āāāāāāāā
ā ā
āāāāāāāā¼āāāāāāā āāāāāāā¼āāāāāāā
ā Python ā ā JavaScript ā
ā Bindings ā ā Bindings ā
ā (PyO3) ā ā (napi-rs) ā
āāāāāāāāāāāāāāā āāāāāāāāāāāāāā
`- Core Logic: Written once in Rust (
TemporalFeaturesCore)
- Python Bindings: Exposed via PyO3 with #[cfg(feature = "python")]
- JavaScript Bindings: Exposed via napi-rs with #[cfg(feature = "javascript")]š¢ Deployment Guide
$3
1. PyPI Account: For Python package publishing
2. npm Account: For JavaScript package publishing
3. GitHub Repository: With Actions enabled
$3
Add the following secrets to your GitHub repository (Settings ā Secrets and variables ā Actions):
-
PYPI_API_TOKEN: Your PyPI API token
- NPM_TOKEN: Your npm access token$3
1. Update Version Numbers:
`bash
# Update version in all three files:
# - Cargo.toml
# - pyproject.toml
# - package.json
`2. Commit and Tag:
`bash
git add .
git commit -m "Release v0.1.1"
git tag v0.1.1
git push origin main
git push origin v0.1.1
`3. Monitor Workflows:
- Go to the "Actions" tab in your GitHub repository
- Two workflows will run:
- Release (Python/PyPI)
- NPM Release (JavaScript/npm)
- Once completed, packages will be available on both PyPI and npm
$3
#### Python (PyPI)
- Workflow:
.github/workflows/release.yml
- Triggers: Tags starting with v*
- Platforms: Linux, Windows, macOS
- Architectures: x86_64, x86, aarch64, armv7, s390x, ppc64le
- Tool: maturin#### JavaScript (npm)
- Workflow:
.github/workflows/npm-release.yml
- Triggers: Tags starting with v*`MIT
Contributions are welcome! Please feel free to submit a Pull Request.
- [ ] Implement temporal feature extraction
- [ ] Add time series transformations
- [ ] Support for multiple time zones
- [ ] Benchmarking suite
- [ ] Comprehensive documentation