GhostLee / python-rust-arrow-interop-example

Example of using the Apache Arrow C Data Interface between Python and Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python-Rust Apache Arrow interop example

This project contains an example Python module, implemented in Rust using pyo3. The Python module accepts an Apache Arrow array and doubles the values in it.

It uses the Apache Arrow C Data Interface.

This code is mostly copied from the Apache Arrow integration test that introduced the interop, with some Clippy warnings fixed.

Usage

Create a virtualenv:

$ python -m venv venv

Enter the virtualenv:

$ source venv/bin/activate

Install Python dependencies:

(venv) $ pip install -r requirements.txt

Build the Rust Python module:

(venv) $ maturin develop

Run the example:

(venv) $ python run.py
[
  2,
  4,
  6
]

Related reading

About

Example of using the Apache Arrow C Data Interface between Python and Rust

License:Apache License 2.0


Languages

Language:Rust 95.9%Language:Python 4.1%