RustPython / RustPython/RustPython
How to make 3rd party rust types available to the VM
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.4k
- Forks
- 1.5k
- Avg merge
- 16h 33m
- Merged PRs (30d)
- 165
Description
Summary
I'm building a little data processing application, in which I'd like be able to add data transformations that are written in python but will be executed by rust under the hood. Eventually I want provide a polars dataframe, and modify it via python.
Something like this:
def transform(df):
df = df.with_columns(
(pl.col("x") * 2).alias("twice")
).collect()
return df
I'm already hitting a road block getting the dataframe in and out of the VM. I tried to build on top of the call_between_rust_and_python example, but it only works with types that are already supported by rustpython or on simple types that are composed of supported types.
I'd be very happy if you'd nugde me into the right direction, given if it's actually possible what I'm trying to achieve.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the call_between_rust_and_python example and the issue's description of the RustPython VM boundary. Determine whether third-party Rust types such as a Polars dataframe can be exposed and modified from Python, and document or implement a supported path with a working round trip demonstrated by an example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100