Skip to content

API reference

Generated from the compiled minarrow module, which must be importable in the documentation build environment.

Arrays and tables

Array

A minarrow array exposed to Python.

arrow_type property

arrow_type

The mapped Arrow logical type.

bit_width property

bit_width

The physical integer width in bits.

dtype property

dtype

The concrete dtype.

is_view property

is_view

Whether this array is a windowed view of a larger buffer.

name property

name

The column name, or None for an unnamed array.

null_count property

null_count

The number of nulls.

from_arrow staticmethod

from_arrow(obj)

Import a PyArrow or Polars array via the Arrow C Data Interface, zero-copy for the primary buffers. An Arrow array carries no column name, so the result is unnamed.

from_cudf staticmethod

from_cudf(obj)

Alias for from_arrow, accepting a cuDF object through the Arrow PyCapsule interface.

from_nanoarrow staticmethod

from_nanoarrow(obj)

Alias for from_arrow, accepting any nanoarrow object through the Arrow PyCapsule interface.

from_pandas staticmethod

from_pandas(obj)

Alias for from_arrow, accepting a pandas object through the Arrow PyCapsule interface.

from_polars staticmethod

from_polars(obj)

Alias for from_arrow, accepting any Polars object through the Arrow PyCapsule interface.

push method descriptor

push(value)

Appends a value to the array. When the Array is in a view state, or another object is referencing the underlying memory, it is materialised to an owned array before appending.

Suited to appending a few values. To build a large array, consider constructing it from a Python sequence in one call, Array([...]), rather than many push calls, since each call crosses the Python boundary.

push_null method descriptor

push_null()

Appends a null to the array. When the Array is in a view state, or another object is referencing the underlying memory, it is materialised to an owned array before appending.

set method descriptor

set(index, value)

Sets the element at index to value. Negative indices count from the end, so -1 is the last element. An out-of-range index raises IndexError. When the Array is in a view state, or another object is referencing the underlying memory, it is materialised to an owned array before the write, leaving the source unchanged.

to_arrow method descriptor

to_arrow()

Export to a PyArrow array via the Arrow C Data Interface.

to_cudf method descriptor

to_cudf()

Convert to a cuDF Series through the Arrow PyCapsule interface. Runs on GPU and requires the cudf package.

to_nanoarrow method descriptor

to_nanoarrow()

Convert to a nanoarrow Array through the Arrow PyCapsule interface. Requires the nanoarrow package.

to_pandas method descriptor

to_pandas()

Convert to a pandas Series through the Arrow PyCapsule interface. Requires pandas 3.0+ (Series.from_arrow).

to_polars method descriptor

to_polars()

Convert to a Polars Series through the Arrow PyCapsule interface. A named array carries its name onto the Series. Requires the polars package.

Table

A minarrow table exposed to Python.

columns property

columns

The column names in order.

dtypes property

dtypes

A name to dtype mapping over the columns, in order.

is_view property

is_view

Whether this table is a view over another table's buffers.

n_cols property

n_cols

The number of columns.

n_rows property

n_rows

The number of rows.

name property

name

The table name, or None when unnamed.

schema property

schema

The table's schema: the column fields in order.

add_column method descriptor

add_column(name, column)

Appends column under name. A view-backed table is materialised first. The column length must match the table's row count unless the table is empty.

from_arrow staticmethod

from_arrow(obj)

Import a PyArrow RecordBatch via the Arrow C Data Interface.

from_cudf staticmethod

from_cudf(obj)

Alias for from_arrow, accepting a cuDF object through the Arrow PyCapsule interface.

from_daft staticmethod

from_daft(obj)

Alias for from_arrow, accepting any Daft object through the Arrow PyCapsule interface.

from_datafusion staticmethod

from_datafusion(obj)

Alias for from_arrow, accepting any DataFusion object through the Arrow PyCapsule interface.

from_duckdb staticmethod

from_duckdb(obj)

Alias for from_arrow, accepting any DuckDB object through the Arrow PyCapsule interface.

from_ibis staticmethod

from_ibis(obj)

Alias for from_arrow, accepting an Ibis object through the Arrow PyCapsule interface.

from_nanoarrow staticmethod

from_nanoarrow(obj)

Alias for from_arrow, accepting any nanoarrow object through the Arrow PyCapsule interface.

from_narwhals staticmethod

from_narwhals(obj)

Alias for from_arrow, accepting a Narwhals object through the Arrow PyCapsule interface.

from_pandas staticmethod

from_pandas(obj)

Alias for from_arrow, accepting a pandas object through the Arrow PyCapsule interface.

from_polars staticmethod

from_polars(obj)

Alias for from_arrow, accepting any Polars object through the Arrow PyCapsule interface.

read_adbc staticmethod

read_adbc(cursor)

Read an ADBC cursor's current result into a Table. Call after cursor.execute(...). cursor is an ADBC DBAPI cursor.

to_arrow method descriptor

to_arrow()

Export to a PyArrow RecordBatch via the Arrow C Data Interface.

to_cudf method descriptor

to_cudf()

Convert to a cuDF DataFrame through the Arrow PyCapsule interface. Runs on GPU and requires the cudf package.

to_daft method descriptor

to_daft()

Convert to a Daft DataFrame through the Arrow PyCapsule interface. Requires the daft package.

to_datafusion method descriptor

to_datafusion()

Convert to a DataFusion DataFrame through the Arrow PyCapsule interface. Requires the datafusion package.

to_duckdb method descriptor

to_duckdb()

Convert to a DuckDB relation through the Arrow PyCapsule interface. Requires the duckdb package.

to_ibis method descriptor

to_ibis()

Convert to an Ibis table expression. Ibis wraps a pyarrow Table, so this requires pyarrow and the ibis-framework package.

to_nanoarrow method descriptor

to_nanoarrow()

Convert to a nanoarrow ArrayStream through the Arrow PyCapsule interface. Requires the nanoarrow package.

to_narwhals method descriptor

to_narwhals()

Convert to a Narwhals DataFrame over a pyarrow Table. Narwhals wraps a native frame, so this requires pyarrow and narwhals.

to_pandas method descriptor

to_pandas()

Convert to a pandas DataFrame through the Arrow PyCapsule interface. Requires pandas 3.0+ (DataFrame.from_arrow).

to_polars method descriptor

to_polars()

Convert to a Polars DataFrame through the Arrow PyCapsule interface. Requires the polars package.

write_adbc method descriptor

write_adbc(cursor, table_name, mode='create')

Ingest this table into a database through an ADBC cursor, over the Arrow PyCapsule interface. cursor is an ADBC DBAPI cursor from a driver such as adbc_driver_sqlite, adbc_driver_postgresql, adbc_driver_snowflake, adbc_driver_bigquery, or adbc_driver_flightsql. mode is one of create, append, replace, or create_append. Returns the row count.

ChunkedArray

An ordered set of Array chunks that share a dtype and field. Wraps minarrow's SuperArray.

arrow_type property

arrow_type

The mapped Arrow logical type.

chunks property

chunks

The chunks in order.

dtype property

dtype

The concrete dtype.

n_chunks property

n_chunks

The number of chunks.

name property

name

The column name, or None when the column is unnamed.

null_count property

null_count

The total number of nulls across all chunks.

chunk method descriptor

chunk(index)

The chunk at index, or None when out of range.

from_arrow staticmethod

from_arrow(obj)

Import a chunked Arrow producer, such as a PyArrow ChunkedArray, through the Arrow C Data Interface.

to_arrow method descriptor

to_arrow()

Export to a PyArrow ChunkedArray through the Arrow C Data Interface.

ChunkedTable

An ordered set of Table batches that share a schema. Wraps minarrow's SuperTable.

batches property

batches

The batches in order.

columns property

columns

The column names in order.

n_batches property

n_batches

The number of batches.

n_chunks property

n_chunks

The number of batches, named to match ChunkedArray.n_chunks.

n_cols property

n_cols

The number of columns.

n_rows property

n_rows

The total number of rows across all batches.

name property

name

The table name.

schema property

schema

The schema attached at construction, or the schema derived from the batches when none was given.

batch method descriptor

batch(index)

The batch at index, or None when out of range.

from_arrow staticmethod

from_arrow(obj)

Import a chunked Arrow producer, such as a PyArrow Table, through the Arrow C Data Interface.

to_arrow method descriptor

to_arrow()

Export to a PyArrow Table through the Arrow C Data Interface.

Data types

DType

The concrete minarrow array type.

Boolean class-attribute

Boolean = Boolean

The concrete minarrow array type.

Categorical class-attribute

Categorical = Categorical

The concrete minarrow array type.

Datetime class-attribute

Datetime = Datetime

The concrete minarrow array type.

Float class-attribute

Float = Float

The concrete minarrow array type.

Integer class-attribute

Integer = Integer

The concrete minarrow array type.

Null class-attribute

Null = Null

The concrete minarrow array type.

String class-attribute

String = String

The concrete minarrow array type.

group property

group

The grouping this dtype belongs to.

is_numeric property

is_numeric

is_temporal property

is_temporal

is_text property

is_text

TypeClass

minarrow's Array enum grouping.

Boolean class-attribute

Boolean = Boolean

minarrow's Array enum grouping.

Null class-attribute

Null = Null

minarrow's Array enum grouping.

Numeric class-attribute

Numeric = Numeric

minarrow's Array enum grouping.

Temporal class-attribute

Temporal = Temporal

minarrow's Array enum grouping.

Text class-attribute

Text = Text

minarrow's Array enum grouping.

ArrowType

The Arrow logical type. A 1:1 mirror of minarrow::ArrowType, including its feature gates. Construct it for a Field, or read it from Array.arrow_type. pyo3 makes each variant callable, so a non-parametric type is built with a call: ArrowType.Int64().

Boolean

Bases: minarrow.ArrowType

Date32

Bases: minarrow.ArrowType

Date64

Bases: minarrow.ArrowType

Dictionary

Bases: minarrow.ArrowType

index property
index

Duration32

Bases: minarrow.ArrowType

unit property
unit

Duration64

Bases: minarrow.ArrowType

unit property
unit

Float32

Bases: minarrow.ArrowType

Float64

Bases: minarrow.ArrowType

Int32

Bases: minarrow.ArrowType

Int64

Bases: minarrow.ArrowType

Interval

Bases: minarrow.ArrowType

unit property
unit

LargeString

Bases: minarrow.ArrowType

Null

Bases: minarrow.ArrowType

String

Bases: minarrow.ArrowType

Time32

Bases: minarrow.ArrowType

unit property
unit

Time64

Bases: minarrow.ArrowType

unit property
unit

Timestamp

Bases: minarrow.ArrowType

tz property
tz
unit property
unit

UInt32

Bases: minarrow.ArrowType

UInt64

Bases: minarrow.ArrowType

Utf8View

Bases: minarrow.ArrowType

CategoricalIndexType

The dictionary key width of a categorical type. Mirrors minarrow::CategoricalIndexType under its feature gates.

UInt32 class-attribute

UInt32 = CategoricalIndexType.UInt32

The dictionary key width of a categorical type. Mirrors minarrow::CategoricalIndexType under its feature gates.

TimeUnit

The unit of a temporal type. Mirrors minarrow::TimeUnit.

Days class-attribute

Days = TimeUnit.Days

The unit of a temporal type. Mirrors minarrow::TimeUnit.

Microseconds class-attribute

Microseconds = TimeUnit.Microseconds

The unit of a temporal type. Mirrors minarrow::TimeUnit.

Milliseconds class-attribute

Milliseconds = TimeUnit.Milliseconds

The unit of a temporal type. Mirrors minarrow::TimeUnit.

Nanoseconds class-attribute

Nanoseconds = TimeUnit.Nanoseconds

The unit of a temporal type. Mirrors minarrow::TimeUnit.

Seconds class-attribute

Seconds = TimeUnit.Seconds

The unit of a temporal type. Mirrors minarrow::TimeUnit.

IntervalUnit

The unit of an interval type. Mirrors minarrow::IntervalUnit.

DaysTime class-attribute

DaysTime = IntervalUnit.DaysTime

The unit of an interval type. Mirrors minarrow::IntervalUnit.

MonthDaysNs class-attribute

MonthDaysNs = IntervalUnit.MonthDaysNs

The unit of an interval type. Mirrors minarrow::IntervalUnit.

YearMonth class-attribute

YearMonth = IntervalUnit.YearMonth

The unit of an interval type. Mirrors minarrow::IntervalUnit.

Fields and schemas

Field

A named column descriptor holding name, Arrow type, nullability, and metadata.

arrow_type property

arrow_type

The Arrow logical type.

dtype property

dtype

The concrete dtype.

metadata property

metadata

The string metadata mapping.

name property

name

The field name.

nullable property

nullable

Whether the field admits nulls.

Schema

An ordered list of fields plus table-level metadata.

fields property

fields

The fields in order.

metadata property

metadata

The string metadata mapping.

names property

names

The field names in order.