Python bindings and package wrapper around the Asset360 Rust module.
pip install "$(
curl -sfL https://api.github.com/repos/Kapernikov/asset360-rust/releases/latest |
jq -r --arg py_tag "cp$(python -c 'import sys; print(sys.version_info.major, sys.version_info.minor, sep="")')" '
.assets
| map(select(.name | endswith(".whl")))
| map(select(.name | test($py_tag)))
| (map(select(.name | test("manylinux"))) + map(select(.name | test("musllinux"))))
| first
| .browser_download_url
'
)"The command fetches the latest release metadata from GitHub, filters for wheels
matching the active Python cpXY tag, prefers manylinux builds, and falls back
to musllinux if that’s all that’s available. Requires curl, jq, and python
on the PATH.
npm install "$(
curl -sfL https://api.github.com/repos/Kapernikov/asset360-rust/releases/latest |
jq -r '
.assets
| map(select(.name | startswith("asset360-rust-") and endswith(".tgz")))
| first
| .browser_download_url
'
)"npm install receives the tarball URL for the newest published release
automatically. Requires curl and jq.
Usage (single import, auto-selects node vs browser):
import { MiniJinjaEnvironment, ready } from 'asset360-rust';
await ready();
const env = new MiniJinjaEnvironment();If you need to force a specific build, the package also exposes asset360-rust/node
and asset360-rust/web subpaths.
- Prerequisites: Python 3.8+, Rust toolchain.
- Create a virtualenv (recommended):
python -m venv .venv && . .venv/bin/activate
- Install maturin:
pip install -U maturin - Build and install in the active environment:
maturin develop
- Test import:
python -c "import asset360_rust as a; print(a.SchemaView)"
maturin build(artifacts in./target/wheelsor./dist)
make wheelbuilds the Python wheel viascripts/build_py.sh(optionalPYTHON_VERSION=x.y).make npmbuilds the Wasm bundle underpkg/.make test-tsruns the TypeScript tests, rebuilding the Wasm bundle first.
- The native extension module is named
asset360_nativeto avoid symbol clashes with the dependency’s own_nativemodule. The Python packageasset360_rustre-exports the same API.
- Install the Wasm target once:
rustup target add wasm32-unknown-unknown. - Build the crate with the new bindings enabled (Python features off):
cargo build --target wasm32-unknown-unknown --no-default-features --features wasm-bindings
- Run
wasm-bindgen(orwasm-pack) to emit the.jsshim and.d.tstypings, for example:wasm-bindgen --target bundler --typescript --out-dir pkg target/wasm32-unknown-unknown/debug/asset360_rust.wasm
- The generated
pkg/asset360_rust.d.tsexposesloadSchemaView, returning aSchemaViewHandlewith trivial inspection helpers for now.