Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Pola rs Polars Polars Crate Cargo Config

From Leeroopedia


Knowledge Sources
Domains Build_System, Feature_Flags
Last Updated 2026-02-09 09:00 GMT

Overview

Concrete tool for configuring the main polars crate's feature flags, dependencies, and optional data type support provided by the Cargo build system.

Description

The polars/Cargo.toml manifest is the public-facing Rust crate configuration. It aggregates 12 internal subcrates (polars-core, polars-lazy, polars-io, polars-ops, polars-parquet, polars-plan, polars-sql, polars-time, etc.) behind a comprehensive feature flag system. The feature architecture has several layers: dtype-* features (16 optional data types including date, datetime, duration, time, array, categorical, struct, decimal, and various integer/float sizes), I/O features (csv, json, parquet, ipc, ipc_streaming, avro, cloud providers), operation features (60+ compute operations like rolling_window, rank, pivot, join variants), and meta features (performant, nightly, simd, avx512). The default feature enables docs, zip_with, csv, parquet, temporal, fmt, and dtype-slim. The full feature activates docs-selection, performant, and fmt for maximum capability.

Usage

This manifest is consumed by Rust developers adding polars as a dependency. Feature selection controls binary size and compilation time. Use default for typical use cases, add specific features as needed, or use full for maximum capability at the cost of longer compilation.

Code Reference

Source Location

Signature

[package]
name = "polars"
description = "DataFrame library based on Apache Arrow"
keywords = ["dataframe", "query-engine", "arrow"]

[dependencies]
polars-core = { workspace = true, features = ["algorithm_group_by"] }
polars-lazy = { workspace = true, optional = true }
polars-io = { workspace = true, optional = true }
# ... additional subcrates

[features]
default = ["docs", "zip_with", "csv", "polars-parquet", "temporal", "fmt", "dtype-slim"]
full = ["docs-selection", "performant", "fmt"]
lazy = ["polars-core/lazy", "polars-lazy"]
parquet = ["polars-parquet", "polars-io", "polars-lazy?/parquet", ...]
csv = ["polars-io", "polars-io/csv", "polars-lazy?/csv", ...]

Import

// In Cargo.toml:
// [dependencies]
// polars = { version = "0.53", features = ["lazy", "parquet", "csv"] }

use polars::prelude::*;

I/O Contract

Inputs

Name Type Required Description
Feature flags Cargo features No Select functionality: lazy, parquet, csv, dtype-*, etc.

Outputs

Name Type Description
polars crate Rust library Complete DataFrame library with selected features

Usage Examples

Minimal Setup

[dependencies]
polars = "0.53"  # default features: csv, parquet, temporal, fmt

Full-Featured Setup

[dependencies]
polars = { version = "0.53", features = ["full"] }

Custom Feature Selection

[dependencies]
polars = { version = "0.53", default-features = false, features = [
    "lazy", "parquet", "csv", "json",
    "dtype-datetime", "dtype-categorical",
    "rolling_window", "rank", "pivot",
    "timezones", "performant",
] }

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment