Jupyter and IPython magic for compiling Python extensions written in Rust
Project description
rustimport_jupyter
Jupyter and IPython magic for compiling Python extensions written in Rust. This project builds on top of rustimport by adding a IPython magic.
Installation
- Install Rust by following Rust's Getting started Guide.
- 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
- NumPy in Rust - Using
rustimport_jupyter
to write NumPy code in Rust! Run in Google Colab 💻 - Running in Google Colab - For Google Colab,
rustimport_jupyter
and therust
toolchain needs to be installed first. Run in Google Colab 💻. - Polars Expression Plugins - Use
rustimport_jupyter
to quickly iterate on Polars expression plugins. Run in Google Colab 💻.
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
Built Distribution
File details
Details for the file rustimport_jupyter-0.1.3.tar.gz
.
File metadata
- Download URL: rustimport_jupyter-0.1.3.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e04c8c41df6f5931fe99f35dcf2664ffb82e48fb33843369da7b45059f88375 |
|
MD5 | 99e4a2336dd36e84ff8847e448646389 |
|
BLAKE2b-256 | 6f97d3473b0e38ef997e678854a538626588d5306f06e0aabf2f90967230ba83 |
Provenance
File details
Details for the file rustimport_jupyter-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: rustimport_jupyter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3051e7df124c206061ef364840da658062a2393975aa66b04a50ca0903b41d5e |
|
MD5 | 940286116c28bfc19269c34fe4d60885 |
|
BLAKE2b-256 | f42d01687211606fdd5ab806659e9c0f21a33a4a8b96e02869ad6b414155f354 |