lazybear

API reference

lazybear provides a polars-inspired lazy API for building sql queries with sqlalchemy-backed execution.

The main object is LazyBearFrame. It represents a lazy sql query and is usually created with scan_table, scan_sql_query, or scan_df.

lazybear is intended to feel familiar to polars users, but it is not intended to be feature complete. The goal is to push filtering, projection, joins, grouping, and limiting into the database so less data needs to be collected locally for analysis.

Contents

Quick example

from lazybear import col, scan_table

users = scan_table('users', eng)

result = (
    users
    .filter(col('age') >= 30)
    .select('id', 'name', 'age')
    .sort('age', descending=True)
    .collect()
)

Notes