polars icon indicating copy to clipboard operation
polars copied to clipboard

Exposing PyDataFrame from a rust library

Open jmrgibson opened this issue 3 years ago • 3 comments

Describe your feature request

I have a rust application using polars & pyo3. All the data collection, processing, etc, is done in rust, but I want the ability to return a pl.DataFrame/PyDataFrame to the user for interactive work in a python terminal.

Unless I'm mistaken, it's not possible to create a PyDataFrame from rust, because py-polars isn't published to crates.io.

I realize I could probably do this by calling python code from rust, I would like to avoid having to have the user install polars (the python library) because we already distribute our rust app as a static binary with no external dependencies.

jmrgibson avatar Aug 04 '22 22:08 jmrgibson

This works: https://github.com/pola-rs/polars/tree/master/examples/python_rust_compiled_function

ritchie46 avatar Aug 05 '22 07:08 ritchie46

I believe this is a duplicate of #1325. I will also say that the example is not really ergonomic to use and fairly brittle to lib change.

jg2562 avatar Aug 05 '22 11:08 jg2562

Closing as duplicate.

jmrgibson avatar Aug 08 '22 20:08 jmrgibson