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 rustimport_jupyter: 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

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

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: rustimport_jupyter-0.1.0.tar.gz
  • Upload date:
  • Size: 11.4 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.0.tar.gz
Algorithm Hash digest
SHA256 c9681b459fe1912728a208f73d64817d301086776dbaf400408dfd85657c8513
MD5 2595bde2e21e14d5b8d3315ab71e9f27
BLAKE2b-256 109b33cdff14acbe42f74e96edfe14c69b958259a69d6aa5324aef872f00742f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rustimport_jupyter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ba380d1cd3dbbf255a9eb16849df70dcfe40971f8dd5703b91e521f7d96138b
MD5 baa8b7689649c92a43dd67118795dea8
BLAKE2b-256 ad2c2e120d196b3f36de16e686f78ba910995fd698887081896513ff828223dc

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