wickra-wasm 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -12
- package/package.json +1 -1
- package/wickra_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
**Streaming-first technical indicators. Install with `pip install wickra` — no system dependencies.**
|
|
19
19
|
|
|
20
20
|
Wickra is a multi-language technical-analysis library with a Rust core and
|
|
21
|
-
bindings for Python, Node.js
|
|
22
|
-
|
|
21
|
+
native bindings for Python, Node.js and WebAssembly, plus a C ABI that any
|
|
22
|
+
C-capable language (C, C++, and beyond) links against. Every indicator is a
|
|
23
|
+
state machine that updates in O(1) per new data point, so live trading bots and
|
|
23
24
|
historical backtests share the exact same implementation.
|
|
24
25
|
|
|
25
26
|
```python
|
|
@@ -71,9 +72,10 @@ times to get there.
|
|
|
71
72
|
breadth, Renko/Kagi/Point&Figure bars, Ehlers DSP cycles, risk/performance
|
|
72
73
|
metrics — every single one updating in **O(1) per tick**. TA-Lib ships ~150 and
|
|
73
74
|
none of them stream.
|
|
74
|
-
- **One Rust core,
|
|
75
|
-
WebAssembly · Rust**
|
|
76
|
-
reimplementation and zero
|
|
75
|
+
- **One Rust core, five first-class targets.** Native **Python · Node.js ·
|
|
76
|
+
WebAssembly · Rust** plus a **C ABI** for C / C++ and any C-capable language —
|
|
77
|
+
identical math, identical results, zero per-language reimplementation and zero
|
|
78
|
+
GIL bottleneck.
|
|
77
79
|
- **Correct by construction, not by hope.** Every `update` validates its input,
|
|
78
80
|
runs a real warmup, and returns an `Option` so a single bad tick can't silently
|
|
79
81
|
poison state. `batch == streaming` is **bit-exact, fuzzed and 100 %-line-covered
|
|
@@ -95,7 +97,7 @@ Every other library forces one of those compromises. Wickra doesn't:
|
|
|
95
97
|
|
|
96
98
|
| Library | Install | Streaming | Languages | Indicators | Active |
|
|
97
99
|
|------------------|-------------|-------------|-----------------------------|-----------:|--------|
|
|
98
|
-
| **★ Wickra**| **clean** | **yes, O(1)** | **Python · Node · WASM · Rust** | **514** | **yes** |
|
|
100
|
+
| **★ Wickra**| **clean** | **yes, O(1)** | **Python · Node · WASM · Rust · C** | **514** | **yes** |
|
|
99
101
|
| kand | clean | yes | Python · WASM · Rust | ~60 | yes |
|
|
100
102
|
| ta-rs | clean | yes | Rust only | ~30 | stale |
|
|
101
103
|
| yata | clean | partial | Rust only | ~35 | yes |
|
|
@@ -166,8 +168,8 @@ as one column each. `Doji` is direction-less by default (`+1.0` / `0.0`);
|
|
|
166
168
|
construct it in signed mode (`Doji::new().signed()`, `Doji(signed=True)`,
|
|
167
169
|
`new Doji(true)`) for a dragonfly / gravestone `±1` reading.
|
|
168
170
|
|
|
169
|
-
Adding a new indicator means implementing one trait in Rust; all
|
|
170
|
-
inherit it automatically.
|
|
171
|
+
Adding a new indicator means implementing one trait in Rust; all five bindings
|
|
172
|
+
inherit it automatically (the C ABI is generated from the core).
|
|
171
173
|
|
|
172
174
|
## Languages
|
|
173
175
|
|
|
@@ -177,12 +179,14 @@ inherit it automatically.
|
|
|
177
179
|
| Node.js (napi-rs) | `npm install wickra` | `examples/node/backtest.js` |
|
|
178
180
|
| Browser / WASM | `npm install wickra-wasm` | `examples/wasm/index.html` |
|
|
179
181
|
| Rust | `cargo add wickra` | `examples/rust/src/bin/backtest.rs` |
|
|
182
|
+
| C / C++ (C ABI) | header + library, see [`bindings/c`](bindings/c) | `examples/c/streaming.c` |
|
|
180
183
|
|
|
181
184
|
Each binding ships several runnable examples (streaming, backtest, live feed);
|
|
182
185
|
[`examples/README.md`](examples/README.md) is the full cross-language index.
|
|
183
186
|
|
|
184
|
-
The wickra-core crate is `unsafe`-forbidden, so
|
|
185
|
-
memory-safe
|
|
187
|
+
The wickra-core crate is `unsafe`-forbidden, so the native bindings are
|
|
188
|
+
memory-safe end to end. The C ABI runs the same safe core; only its thin FFI
|
|
189
|
+
boundary uses `unsafe`, and the caller owns handle lifetimes (`_new` / `_free`).
|
|
186
190
|
|
|
187
191
|
## Rust API
|
|
188
192
|
|
|
@@ -244,13 +248,15 @@ wickra/
|
|
|
244
248
|
├── bindings/
|
|
245
249
|
│ ├── python/ PyO3 + maturin (publishes on PyPI)
|
|
246
250
|
│ ├── node/ napi-rs (publishes on npm)
|
|
247
|
-
│
|
|
251
|
+
│ ├── wasm/ wasm-bindgen (browsers, bundlers, Node)
|
|
252
|
+
│ └── c/ C ABI (cdylib + staticlib) + generated include/wickra.h
|
|
248
253
|
├── examples/ examples/README.md indexes every language
|
|
249
254
|
│ ├── data/ real BTCUSDT OHLCV datasets, one per timeframe
|
|
250
255
|
│ ├── rust/ Rust workspace member (`wickra-examples`)
|
|
251
256
|
│ ├── python/ backtest, live trading, parallel assets, multi-tf
|
|
252
257
|
│ ├── node/ streaming, backtest, live trading (load `wickra`)
|
|
253
|
-
│
|
|
258
|
+
│ ├── wasm/ browser demo for `wickra-wasm`
|
|
259
|
+
│ └── c/ C smoke + streaming, C++ RAII wrapper
|
|
254
260
|
└── .github/workflows/ CI and release pipelines
|
|
255
261
|
```
|
|
256
262
|
|
|
@@ -278,6 +284,11 @@ wasm-pack build bindings/wasm --target web --release --features panic-hook
|
|
|
278
284
|
|
|
279
285
|
# Node binding (requires @napi-rs/cli)
|
|
280
286
|
cd bindings/node && npm install && npm run build && npm test
|
|
287
|
+
|
|
288
|
+
# C ABI (cdylib + staticlib + generated header)
|
|
289
|
+
cargo build -p wickra-c --release
|
|
290
|
+
cmake -S examples/c -B examples/c/build -DWICKRA_LIB_DIR="$PWD/target/release"
|
|
291
|
+
cmake --build examples/c/build && ctest --test-dir examples/c/build --output-on-failure
|
|
281
292
|
```
|
|
282
293
|
|
|
283
294
|
## Testing
|
package/package.json
CHANGED
package/wickra_wasm_bg.wasm
CHANGED
|
Binary file
|