API reference

Every name below is importable directly from the top-level colstore package.

Opening & reading

open

Open an existing .cstore file, or several as one logical dataset.

ColStoreReader

Memory-mapped columnar store with lazy, NumPy-style indexing.

ColumnView

Lazy view of a single column produced by indexing with a string name.

TableView

View of multiple columns produced by any non-string indexing.

info

Return a summary of the file at path without reading any record bodies.

schema

Return the column schema of path without reading any record bodies.

ColStoreInfo

Summary of a colstore file's contents and on-disk shape.

Writing

store

One-shot: write a single-record file and return an opened reader.

create

Open a new file for streaming writes; fail if it already exists.

recreate

Open a file for streaming writes, truncating any existing content.

update

Open an existing file for append.

ColStoreWriter

Append-only writer for a colstore file.

compact

Collapse a multi-record file into a single-record file.

Datasets & shards

ColStoreDataset

One or more same-schema .cstore files presented as one logical table.

concat

Combine several same-schema sources, lazily or into one written file.

append

Append data to the dataset at directory as one new shard.

appender

Open a streaming Appender for the dataset at directory.

Appender

Streaming append: roll new shards into a dataset directory from a batch stream.

Editing (frames)

ColStoreFrame

A deferred editing view over an opened store's columns.

col

A lazy reference to a column, for building filter expressions.

Format interop

convert

Convert files between colstore's format and another, one endpoint being .cstore.

saveas

Write a reader, dataset, or view to a file -- the function form of source.saveas.

to_root

Write a colstore reader, dataset, or selection out to a ROOT file.

from_parquet

Import a Parquet file into a .cstore (convert(..., format="parquet")).

from_feather

Import a Feather file into a .cstore (convert(..., format="feather")).

from_json

Import a JSON file into a .cstore (convert(..., format="json")).

from_npz

Import a NumPy .npz file into a .cstore (convert(..., format="npz")).

from_hdf

Import an HDF5 file into a .cstore (convert(..., format="hdf5")).

from_root

Convert a ROOT source into a .cstore file and open it for reading.

Configuration & diagnostics

calibrate

Measure and select a near-optimal gather thread cap for this machine.

ensure_calibrated

Apply a cached cap if present, otherwise calibrate once and cache it.

set_max_workers

Set the package-wide thread count for multi-column reads.

get_max_workers

Return the package-wide default thread count for multi-column reads.

set_gather_thread_cap

Set the per-call gather thread cap (>= 1).

get_gather_thread_cap

Return the maximum OpenMP threads a single gather kernel call may use.

set_default_backend

Set the default gather backend ("cpp" or "numpy").

get_default_backend

Return the default gather backend for new ColStoreReader opens.

set_default_madvise

Set the package-wide default madvise hint for new ColStoreReader opens.

get_default_madvise

Return the default madvise hint applied to new ColStoreReader opens.

max_threads

Return the gather kernel's max thread count (1 without OpenMP).

cpp_available

Return whether the compiled C++ gather extension is importable.

use_passive_openmp_wait

Opt into OMP_WAIT_POLICY=passive so idle OpenMP threads sleep.

Exceptions

FormatError

Raised when a file does not match the expected colstore format.

QueryError

A query string or column expression is malformed or unsupported.