Embed a small bit of code that converts between units. An example of a Rust library that can be embedded in Python and Web Assembly.
Go to file
Dorian 4000c1a86a Add instructions and test for running against pytest. 2019-02-06 09:04:04 -05:00
src Wire up to run function as Python code. 2019-02-06 08:57:13 -05:00
.gitignore Create a quick calculation and test to make sure it works. 2019-02-04 09:05:11 -05:00
Cargo.toml Wire up to run function as Python code. 2019-02-06 08:57:13 -05:00
LICENSE.md Add a basic readme and desire of the project. 2019-02-01 08:41:54 -05:00
Pipfile Wire up to run function as Python code. 2019-02-06 08:57:13 -05:00
Pipfile.lock Wire up to run function as Python code. 2019-02-06 08:57:13 -05:00
README.md Add instructions and test for running against pytest. 2019-02-06 09:04:04 -05:00
test.py Add instructions and test for running against pytest. 2019-02-06 09:04:04 -05:00

README.md

Embedded Unit Converter

Embed a small bit of code that converts between units of measure, e.g. Fahrenheit to Celsius.

An example of a Rust library that is embeddable in Python and Web Assembly.

Getting setup

Insure the following dependencies are in place:

  • Rust v1.32+ (nightly)
    • Install using rustup toolchain install nightly
    • Set default toolchain rustup default nightly
  • Python 3 Development headers (python3-dev in Ubuntu)
  • pipenv pip install --user pipenv

Running the Python example

  1. Build the rust crate first: cargo build
  2. Create the Python package with: pyo3 develop
  3. Run the tests: pytest test.py

Documentation