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.2.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

rustimport_jupyter-0.1.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file rustimport_jupyter-0.1.2.tar.gz.

File metadata

  • Download URL: rustimport_jupyter-0.1.2.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

Hashes for rustimport_jupyter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 76274927a7953f19567f6444ae0a481722c95afc8850386a27b474bcace06af6
MD5 ae7a3a48d20216e83ae50059c8294bf0
BLAKE2b-256 c1b4de35c568d3cfbe019f900f9740d579f1d572e8e5f06d1da9d413f7ad625f

See more details on using hashes here.

File details

Details for the file rustimport_jupyter-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rustimport_jupyter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b1e9d86a2b45ca56dd58f6bb8a4d5d68a274285c4e5992d3a4eaf961974f5748
MD5 468ad09e7d2af422c8d44a58601c12da
BLAKE2b-256 9e96876c2c1c303708169f9913598312af294c0ac1f9738c92b826d89b1ecbc0

See more details on using hashes here.

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