Input/output#

CSV#

read_csv(source, *[, has_header, columns, ...])

Read a CSV file into a DataFrame.

read_csv_batched(source, *[, has_header, ...])

Read a CSV file in batches.

scan_csv(source, *[, has_header, separator, ...])

Lazily read from a CSV file or multiple files via glob patterns.

DataFrame.write_csv()

Write to comma-separated values (CSV) file.

Feather/ IPC#

read_ipc(source, *[, columns, n_rows, ...])

Read into a DataFrame from Arrow IPC (Feather v2) file.

scan_ipc(source, *[, n_rows, cache, ...])

Lazily read from an Arrow IPC (Feather v2) file or multiple files via glob patterns.

read_ipc_schema(source)

Get the schema of an IPC file without reading data.

DataFrame.write_ipc()

Write to Arrow IPC binary stream or Feather file.

LazyFrame.sink_ipc(path, *[, compression, ...])

Persists a LazyFrame at the provided path.

Parquet#

read_parquet(source, *[, columns, n_rows, ...])

Read into a DataFrame from a parquet file.

scan_parquet(source, *[, n_rows, cache, ...])

Lazily read from a parquet file or multiple files via glob patterns.

read_parquet_schema(source)

Get the schema of a Parquet file without reading data.

DataFrame.write_parquet(file, *[, ...])

Write to Apache Parquet file.

LazyFrame.sink_parquet(path, *[, ...])

Persists a LazyFrame at the provided path.

Database#

read_database(query, connection, *[, ...])

Read the results of a SQL query into a DataFrame.

DataFrame.write_database(table_name, ...[, ...])

Write a polars frame to a database.

JSON#

read_json(source, *[, schema, schema_overrides])

Read into a DataFrame from a JSON file.

read_ndjson(source, *[, schema, ...])

Read into a DataFrame from a newline delimited JSON file.

scan_ndjson(source, *[, ...])

Lazily read from a newline delimited JSON file or multiple files via glob patterns.

DataFrame.write_json()

Serialize to JSON representation.

DataFrame.write_ndjson()

Serialize to newline delimited JSON representation.

AVRO#

read_avro(source, *[, columns, n_rows])

Read into a DataFrame from Apache Avro format.

DataFrame.write_avro(file[, compression])

Write to Apache Avro file.

Excel#

read_excel()

Read Excel (XLSX) sheet into a DataFrame.

DataFrame.write_excel([workbook, worksheet, ...])

Write frame data to a table in an Excel workbook/worksheet.

Delta Lake#

scan_delta(source, *[, version, ...])

Lazily read from a Delta lake table.

read_delta(source, *[, version, columns, ...])

Reads into a DataFrame from a Delta lake table.

DataFrame.write_delta(target, *[, mode, ...])

Write DataFrame as delta table.

Datasets#

Connect to pyarrow datasets.

scan_pyarrow_dataset(source, *[, ...])

Scan a pyarrow dataset.

BatchedCsvReader#

This reader comes available by calling pl.read_csv_batched.

BatchedCsvReader.next_batches(n)

Read n batches from the reader.