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.
To enable this feature load the rustimport_jupyter
extension from within the Jupyter notebook:
%load_ext rustimport_jupyter
Then, 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.1.tar.gz
.
File metadata
- Download URL: rustimport_jupyter-0.1.1.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 | a23796899acc6667cce45e7841b1c698994d1925941b07de494b808bdb991e65 |
|
MD5 | 1591d459aedc709ed027c0ebcb80e46e |
|
BLAKE2b-256 | 8955fd0d2dcb9d8239bc78ed5d9feaeafb2a0cda408831ffa932f3fbf0124eb0 |
File details
Details for the file rustimport_jupyter-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: rustimport_jupyter-0.1.1-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 | c83350667b59c384d86ef01e3480c9ff686779cad722c80013e4263b8564e9be |
|
MD5 | d773639d76a3f8b16fc768a2faec5576 |
|
BLAKE2b-256 | 51e70f8d7eff17f5db903b7633e864b5c91c1137ae3ee506847d66bc156c81d5 |