polars library

Direct native-handle access to Polars expressions, plans, frames, Series, selectors, SQL, jobs, streaming, and Arrow interchange.

Create an installed-package runtime with Polars.native. During source development, Polars.open loads an explicitly built native library.

Classes

ArrayType
The Polars Array type: fixed-width lists of inner values.
ArrowArray
ArrowArrayBuilder
ArrowBinaryType
ArrowBinaryValue
ArrowBooleanType
ArrowBooleanValue
ArrowCData
Owns heap-allocated Arrow C Data structs and their release callbacks. close and the native finalizers release each live callback exactly once.
ArrowCStream
Owns a heap-allocated Arrow C Stream and its release callback.
ArrowDataType
ArrowDateType
ArrowDecimalType
ArrowDecimalValue
ArrowDictionaryIndexValue
ArrowDictionaryType
ArrowDurationType
ArrowExtensionType
ArrowExtensionValue
ArrowField
ArrowFixedSizeBinaryType
Fixed-width binary: every value has exactly byteWidth bytes.
ArrowFixedSizeListType
ArrowFloatingType
ArrowFloatingValue
An IEEE floating-point bit pattern. This preserves NaN payloads and signed zero.
ArrowIntegerType
ArrowIntegerValue
ArrowIntervalType
Calendar interval in the given unit.
ArrowIntervalValue
An Arrow interval. Only the components relevant to unit are non-zero: yearMonth uses months; dayTime uses days and milliseconds; monthDayNano uses months, days, and nanoseconds.
ArrowIpcFileReader
Reads an Arrow IPC random-access file (ARROW1 magic plus footer).
ArrowIpcFileWriter
Writes an Arrow IPC random-access file.
ArrowIpcLimits
Resource limits applied while decoding untrusted IPC input.
ArrowIpcStreamReader
Reads an Arrow IPC stream (a sequence of encapsulated messages).
ArrowIpcStreamWriter
Writes an Arrow IPC stream terminated by the end-of-stream marker.
ArrowListType
ArrowListValue
ArrowMapEntry
One key/value pair of an ArrowMapValue. Keys are never null.
ArrowMapType
Arrow Map: a list of non-null entries structs of <key, value>.
ArrowMapValue
An Arrow map row. Entry order is preserved and duplicate keys are retained, matching the physical list-of-entries layout.
ArrowNullType
ArrowRunEndEncodedType
Run-end encoded data. runEndsField must be a non-nullable int16, int32, or int64 field. Arrays of this type hold logical per-row values.
ArrowSchema
ArrowStringValue
ArrowStructEntry
ArrowStructType
ArrowStructValue
Ordered struct members. Names are retained to detect field-order mistakes.
ArrowTable
An immutable schema plus its record batches.
ArrowTemporalValue
A raw date/time/timestamp/duration counter in the datatype's declared unit.
ArrowTimestampType
ArrowTimeType
ArrowUnionType
Arrow sparse or dense union. Each child has a type id (default its index).
ArrowUnionValue
A union row tagged with its child typeId. A null value is a null in the selected child (unions have no top-level validity bitmap).
ArrowUtf8Type
ArrowValue
AsOfJoinOptions
BatchStream
Owns a bounded native batch stream handle.
BatchStreamPoll
One non-blocking pull result. frame is present exactly in BatchStreamState.batch.
BinaryOffsetType
The Polars BinaryOffset type: offset-based binary storage.
BinaryType
The Polars Binary type: arbitrary byte sequences.
BooleanType
The Polars Boolean type.
CancellableQuery
CArrowArray
ABI-exact Arrow C Data Interface array structure.
CArrowArrayStream
ABI-exact Arrow C Stream Interface structure.
CArrowSchema
ABI-exact Arrow C Data Interface schema structure.
CategoricalType
The Polars Categorical type. Descriptor-only.
CsvWriteOptions
DataFrame
DateTimeType
The Polars Datetime type: a timestamp at a given unit.
DateType
The Polars Date type: calendar dates without a time of day.
DecimalType
The Polars Decimal type: fixed-point numbers.
DType
A Polars data type descriptor.
DTypeCapabilities
The set of DTypeCapability levels supported for a data type.
DTypeSelector
A composable predicate over Polars datatypes.
DurationType
The Polars Duration type: an elapsed time at a given unit.
DynamicGroupByOptions
EnumType
The Polars Enum type: a fixed, ordered set of string categories.
EwmOptions
ExecutionOptions
Expr
ExprArrayNameSpace
ExprBinaryNameSpace
ExprCategoricalNameSpace
ExprDateTimeNameSpace
ExprListNameSpace
ExprMetaNameSpace
ExprNameNameSpace
ExprStringNameSpace
ExprStructNameSpace
ExtensionType
A Polars extension type layered over a storage type. Descriptor-only.
Field
A named, typed member of a StructType.
Float16Type
The Polars Float16 type: IEEE 754 half-precision floats.
Float32Type
The Polars Float32 type: IEEE 754 single-precision floats.
Float64Type
The Polars Float64 type: IEEE 754 double-precision floats.
Int128Type
The Polars Int128 type: signed 128-bit integers.
Int16Type
The Polars Int16 type: signed 16-bit integers.
Int32Type
The Polars Int32 type: signed 32-bit integers.
Int64Type
The Polars Int64 type: signed 64-bit integers.
Int8Type
The Polars Int8 type: signed 8-bit integers.
IpcScanOptions
IpcStreamReadOptions
IpcStreamWriteOptions
IpcWriteOptions
JobStatus
JoinOptions
Typed ordinary join options.
JoinWhereOptions
JsonReadOptions
LazyDynamicGroupBy
LazyFrame
LazyGroupBy
LazyRollingGroupBy
LazySinkOptions
ListType
The Polars List type: variable-length lists of inner values.
NativeAssetProtocolClient
A protocol client resolved through the package's bundled native code asset.
NativeHelloCapabilities
An immutable view of the native hello capability payload. No support is inferred from Dart descriptor classes: absent native fields remain absent.
NativeProtocolClient
Protocol client backed by the stable df_abi_version, df_invoke, df_buffer_free, df_handle_release, df_handle_token_new, and df_handle_token_release C ABI symbols.
NdjsonScanOptions
NullType
The Polars Null type, whose values are all null.
ObjectType
The Polars Object type for opaque values. Descriptor-only.
OptimizerOptions
Overrides selected Polars 0.55.2 optimizer flags.
OwnedBatchJsonCodec
JSON codec for the protocol's copied, binding-owned logical column batches.
ParquetStatisticsOptions
ParquetWriteOptions
Polars
An explicit native Polars runtime. Every resource created through this object belongs exclusively to this runtime, even when two runtimes were constructed from the same ProtocolClient.
PolarsDuration
A Polars duration string such as 15m, 2h30m, 1d, or 10i.
ProfileResult
The materialized query result and Polars node timings (microseconds).
ProtocolClient
ProtocolInvoker
Injectable transport. Test transports can implement this without loading FFI.
RecordBatch
RecordBatchCodec
Copied-column conversion between Arrow's owned batches and the native JSON batch representation.
RollingGroupByOptions
RollingOptions
RuntimeDiagnostics
A read-only snapshot of the native runtime's owned handle registry.
Scalar
An immutable, explicitly typed protocol literal.
Selector
A schema-dependent column selector.
SelectorFactory
Runtime-bound constructors for selectors and datatype selectors.
Series
An immutable, independently owned native Polars Series.
SqlContext
A mutable native Polars SQL catalog.
StringParseOptions
StringType
The Polars String type: UTF-8 text.
StructType
The Polars Struct type: a record of named fields. Descriptor-only.
Then
TimeType
The Polars Time type: a time of day without a date.
UInt128Type
The Polars UInt128 type: unsigned 128-bit integers.
UInt16Type
The Polars UInt16 type: unsigned 16-bit integers.
UInt32Type
The Polars UInt32 type: unsigned 32-bit integers.
UInt64Type
The Polars UInt64 type: unsigned 64-bit integers.
UInt8Type
The Polars UInt8 type: unsigned 8-bit integers.
UnknownType
A placeholder type that Polars has not yet resolved. Descriptor-only.
When
WindowOptions
WindowOrderOptions

Enums

ArrowDateUnit
ArrowIntervalUnit
Arrow interval unit, as in IntervalUnit from Schema.fbs.
ArrowOffsetWidth
Physical layout family for variable-length string, binary, and list data.
ArrowTimeUnit
ArrowUnionMode
Arrow union physical layout.
AsOfStrategy
BatchStreamState
CategoricalPhysical
The physical integer width used to store categorical codes.
ClosedWindow
CsvQuoteStyle
DiffNullBehavior
DTypeCapability
A level of support that the binding offers for a DType.
DynamicGroupLabel
DynamicGroupStartBy
ExecutionEngine
Polars 0.55.2 execution engines.
ExplainFormat
InterpolationMethod
IpcCompression
JobState
JoinMaintainOrder
JoinMode
JoinValidation
ParquetCompression
RankMethod
RoundMode
TimeUnit
The resolution of temporal types such as DateTimeType.
TimeZoneSelectorMode
The time-zone set used by a datetime datatype selector.
UnknownKind
The flavour of a not-yet-resolved UnknownType.
WindowMapping

Extensions

EagerDataFrameOperations on DataFrame
LocalIoDataFrame on DataFrame
LocalIoLazyFrame on LazyFrame
LocalIoPolars on Polars

Constants

protocolVersion → const int
simpleDTypes → const List<DType>
The 20 parameterless data types, from NullType through TimeType.

Properties

allDTypes → List<DType>
One representative for each of the 31 descriptors advertised by protocol v2. Parameterized representatives are illustrative; inspect DType.capabilities before attempting copied import/export or literals.
final

Functions

expandRunEnds(ArrowRunEndEncodedType type, List<int> runEnds, List<ArrowValue?> runValues, {int? maxLength}) → List<ArrowValue?>
Expands a run-end encoding to logical rows, validating run ends.
nestedDictionaryTypes(ArrowDataType type) → List<ArrowDictionaryType>
The dictionary types strictly inside type, in ArrowArray.nestedDictionaries order.
validateArrowValue(ArrowDataType type, ArrowValue value, {String path = 'value'}) → void

Typedefs

CollectJob = CancellableQuery

Exceptions / Errors

ComputeException
Polars failed while executing a query or computation.
InternalPolarsException
An unexpected internal failure, or an unrecognized native error category.
InvalidRequestException
The native runtime rejected a request as malformed or invalid.
PolarsException
Base class for failures reported by the native Polars runtime.
PolarsIoException
Reading or writing a file or stream failed in the native runtime.
ProtocolMismatchException
The Dart package and native library disagree on the wire protocol.
QueryCancelledException
A running query was cancelled before it produced a result.
StaleHandleException
A native handle was used after it was closed or was otherwise invalid.
UnsupportedPolarsException
The requested operation or data type is not supported by this binding.