Skip to content

Repository files navigation

PolarsEx

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.

Goals

  • 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

Status

🚧 Work in progress — Initial scaffolding complete.

Installation

def deps do
  [
    {:polars_ex, "~> 0.1.0"}
  ]
end

Usage

alias PolarsEx.DataFrame

df = DataFrame.new(%{
  "a" => [1, 2, 3],
  "b" => ["x", "y", "z"]
})

DataFrame.select(df, ["a"])
|> DataFrame.filter(col("a") > 1)
|> DataFrame.collect()

Development

# 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 --all

Architecture

lib/
├── 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

License

MIT

About

Elixir bindings for Polars using Rustler — mirroring the Python API

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages