wasm-micro-runtime/language-bindings/python
Enrico Loparco 7692f32a94
Allow overriding max memory on module instantiation (#3198)
This PR adds a max_memory_pages parameter to module instantiation APIs,
to allow overriding the max memory defined in the WASM module.

Sticking to the max memory defined in the module is quite limiting when
using shared memory in production. If targeted devices have different
memory constraints, many wasm files have to be generated with different
max memory values. And device constraints may not be known in advance.

Being able to set the max memory value during module instantiation allows
to reuse the same wasm module, e.g. by retrying instantiation with different
max memory value.
2024-03-05 17:53:26 +08:00
..
src/wamr Allow overriding max memory on module instantiation (#3198) 2024-03-05 17:53:26 +08:00
utils wamr-python: Enable debugging WASM and grant dir access (#2449) 2023-08-15 10:32:43 +08:00
wamr-api wamr-python: Enable debugging WASM and grant dir access (#2449) 2023-08-15 10:32:43 +08:00
wasm-c-api Allow overriding max memory on module instantiation (#3198) 2024-03-05 17:53:26 +08:00
.gitignore Implement Python language binding (#1192) (#1195) 2022-05-31 16:39:46 +08:00
LICENSE Implement Python language binding (#1192) (#1195) 2022-05-31 16:39:46 +08:00
MANIFEST.in Add WAMR API bindings in Python (#1959) 2023-02-16 15:21:28 +08:00
pyproject.toml Fix wamrapi python binding for darwin (#1978) 2023-02-21 18:35:15 +08:00
README.md The Python language-binding needs python>=3.9 (#2228) 2023-05-24 08:15:28 +08:00
setup.py The Python language-binding needs python>=3.9 (#2228) 2023-05-24 08:15:28 +08:00

wamr-python

The WAMR Python package contains a set of high-level bindings for WAMR API and WASM-C-API.

Installation

  • Notice: This python package need python >= 3.9.

To Install from local source tree in development mode run the following command,

python -m pip install -e .

In this mode the package appears to be installed but still is editable from the source tree.

Usage

From the same package you can use two set of APIs.

To use the WAMR API you can import the symbols as follows,

from wamr.wamrapi.wamr import Engine, Module, Instance, ExecEnv

In the order hand, to use the WASM-C-API,

import wamr.wasmcapi.ffi as ffi

For more information: