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.
from_arrow
staticmethod
¶
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
¶
Alias for from_arrow, accepting a cuDF object through the Arrow
PyCapsule interface.
from_nanoarrow
staticmethod
¶
Alias for from_arrow, accepting any nanoarrow object through the Arrow
PyCapsule interface.
from_pandas
staticmethod
¶
Alias for from_arrow, accepting a pandas object through the Arrow
PyCapsule interface.
from_polars
staticmethod
¶
Alias for from_arrow, accepting any Polars object through the Arrow
PyCapsule interface.
push
method descriptor
¶
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
¶
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
¶
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_cudf
method descriptor
¶
Convert to a cuDF Series through the Arrow PyCapsule interface. Runs on
GPU and requires the cudf package.
to_nanoarrow
method descriptor
¶
Convert to a nanoarrow Array through the Arrow PyCapsule interface.
Requires the nanoarrow package.
to_pandas
method descriptor
¶
Convert to a pandas Series through the Arrow PyCapsule interface.
Requires pandas 3.0+ (Series.from_arrow).
to_polars
method descriptor
¶
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.
add_column
method descriptor
¶
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
¶
Import a PyArrow RecordBatch via the Arrow C Data Interface.
from_cudf
staticmethod
¶
Alias for from_arrow, accepting a cuDF object through the Arrow
PyCapsule interface.
from_daft
staticmethod
¶
Alias for from_arrow, accepting any Daft object through the Arrow
PyCapsule interface.
from_datafusion
staticmethod
¶
Alias for from_arrow, accepting any DataFusion object through the Arrow
PyCapsule interface.
from_duckdb
staticmethod
¶
Alias for from_arrow, accepting any DuckDB object through the Arrow
PyCapsule interface.
from_ibis
staticmethod
¶
Alias for from_arrow, accepting an Ibis object through the Arrow
PyCapsule interface.
from_nanoarrow
staticmethod
¶
Alias for from_arrow, accepting any nanoarrow object through the Arrow
PyCapsule interface.
from_narwhals
staticmethod
¶
Alias for from_arrow, accepting a Narwhals object through the Arrow
PyCapsule interface.
from_pandas
staticmethod
¶
Alias for from_arrow, accepting a pandas object through the Arrow
PyCapsule interface.
from_polars
staticmethod
¶
Alias for from_arrow, accepting any Polars object through the Arrow
PyCapsule interface.
read_adbc
staticmethod
¶
Read an ADBC cursor's current result into a Table. Call after
cursor.execute(...). cursor is an ADBC DBAPI cursor.
to_arrow
method descriptor
¶
Export to a PyArrow RecordBatch via the Arrow C Data Interface.
to_cudf
method descriptor
¶
Convert to a cuDF DataFrame through the Arrow PyCapsule interface. Runs
on GPU and requires the cudf package.
to_daft
method descriptor
¶
Convert to a Daft DataFrame through the Arrow PyCapsule interface.
Requires the daft package.
to_datafusion
method descriptor
¶
Convert to a DataFusion DataFrame through the Arrow PyCapsule interface.
Requires the datafusion package.
to_duckdb
method descriptor
¶
Convert to a DuckDB relation through the Arrow PyCapsule interface.
Requires the duckdb package.
to_ibis
method descriptor
¶
Convert to an Ibis table expression. Ibis wraps a pyarrow Table, so
this requires pyarrow and the ibis-framework package.
to_nanoarrow
method descriptor
¶
Convert to a nanoarrow ArrayStream through the Arrow PyCapsule
interface. Requires the nanoarrow package.
to_narwhals
method descriptor
¶
Convert to a Narwhals DataFrame over a pyarrow Table. Narwhals wraps
a native frame, so this requires pyarrow and narwhals.
to_pandas
method descriptor
¶
Convert to a pandas DataFrame through the Arrow PyCapsule interface.
Requires pandas 3.0+ (DataFrame.from_arrow).
to_polars
method descriptor
¶
Convert to a Polars DataFrame through the Arrow PyCapsule interface.
Requires the polars package.
write_adbc
method descriptor
¶
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.
ChunkedTable ¶
An ordered set of Table batches that share a schema. Wraps minarrow's
SuperTable.
schema
property
¶
The schema attached at construction, or the schema derived from the batches when none was given.
from_arrow
staticmethod
¶
Import a chunked Arrow producer, such as a PyArrow Table, through the
Arrow C Data Interface.
to_arrow
method descriptor
¶
Export to a PyArrow Table through the Arrow C Data Interface.
Data types¶
DType ¶
The concrete minarrow array type.
TypeClass ¶
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
Float32 ¶
Bases: minarrow.ArrowType
Float64 ¶
Bases: minarrow.ArrowType
Int32 ¶
Bases: minarrow.ArrowType
Int64 ¶
Bases: minarrow.ArrowType
LargeString ¶
Bases: minarrow.ArrowType
Null ¶
Bases: minarrow.ArrowType
String ¶
Bases: minarrow.ArrowType
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
¶
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
¶
The unit of a temporal type. Mirrors minarrow::TimeUnit.
Microseconds
class-attribute
¶
The unit of a temporal type. Mirrors minarrow::TimeUnit.
Milliseconds
class-attribute
¶
The unit of a temporal type. Mirrors minarrow::TimeUnit.
Nanoseconds
class-attribute
¶
The unit of a temporal type. Mirrors minarrow::TimeUnit.
Seconds
class-attribute
¶
The unit of a temporal type. Mirrors minarrow::TimeUnit.
IntervalUnit ¶
The unit of an interval type. Mirrors minarrow::IntervalUnit.
Fields and schemas¶
Field ¶
A named column descriptor holding name, Arrow type, nullability, and metadata.