Elixir bindings for Polars using Rustler.
This project aims to provide an idiomatic Elixir API that closely mirrors the Python Polars API, while leveraging the full power of the Rust implementation through NIFs.
- Mirror the Python Polars API as closely as possible
- Maintain Rust idioms in the NIF layer
- Provide an idiomatic Elixir layer on top
- Port the Python test suite to Elixir
🚧 Work in progress — Initial scaffolding complete.
def deps do
[
{:polars_ex, "~> 0.1.0"}
]
endalias PolarsEx.DataFrame
df = DataFrame.new(%{
"a" => [1, 2, 3],
"b" => ["x", "y", "z"]
})
DataFrame.select(df, ["a"])
|> DataFrame.filter(col("a") > 1)
|> DataFrame.collect()# Compile (builds Rust NIFs)
mix deps.get
mix compile
# Run tests
mix test
# Format
mix format
cargo fmt --manifest-path=native/polars_ex/Cargo.toml --alllib/
├── polars_ex.ex # Main entry point
├── polars_ex/
│ ├── data_frame.ex # DataFrame API
│ ├── series.ex # Series API
│ ├── expr.ex # Expression API
│ ├── lazy_frame.ex # LazyFrame API
│ └── native.ex # NIF bindings
native/polars_ex/
├── src/
│ ├── lib.rs # NIF registration
│ ├── dataframe.rs # DataFrame NIFs
│ ├── series.rs # Series NIFs
│ ├── expressions.rs # Expression NIFs
│ └── lazyframe.rs # LazyFrame NIFs
└── Cargo.toml
MIT