Skip to main content

Jupyter and IPython magic for compiling Python extensions written in Rust

Project description

rustimport_jupyter

PyPI - Version PyPI - Python Version

Jupyter and IPython magic for compiling Python extensions written in Rust. This project builds on top of rustimport by adding a IPython magic.

Installation

  1. Install Rust by following Rust's Getting started Guide.
  2. Install package: pip install rustimport_jupyter

How To Use

rustimport_jupyter compiles Python extensions written in Rust in Jupyter notebooks. We enable the feature by loading the rustimport_jupyter extension from within a Jupyter notebook:

%load_ext rustimport_jupyter

Next, we prefix a cell with the %%rustimport marker to compile it:

%%rustimport
use pyo3::prelude::*;

#[pyfunction]
fn square(x: i32) -> i32 {
    x * x
}

Notebook Examples

License

rustimport_jupyter is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rustimport_jupyter-0.1.3.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

rustimport_jupyter-0.1.3-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page