Moltres Documentation
Moltres is the missing DataFrame layer for SQL in Python. It provides a PySpark-style DataFrame API that compiles to SQL and executes directly in your database with full SQL CRUD support and optional pandas/polars result formats.
Use these docs to:
Understand Moltres concepts and architecture
Follow step‑by‑step guides and recipes
Explore framework and tooling integrations
Look up the full, generated API reference
Note
New to Moltres? Start with Quick Start (5 minutes) (5 minutes), then Complete Getting Started Tutorial for the full tutorial, then Public API, then Example Scripts for runnable scripts.
Start here
Getting started & migration
Getting started & migration
Guides & how-to
Guides & how-to
- Common Patterns and Use Cases
- Performance Optimization Guide
- Error Handling and Debugging Guide
- Advanced Topics
- Best Practices Guide
- Using the Pandas-Style Interface in Moltres
- Overview
- Getting Started
- Filtering with Query
- String Accessor
- Data Inspection
- GroupBy Operations
- Merging DataFrames
- Sorting
- Dropping Duplicates
- Assigning New Columns
- Renaming Columns
- Dropping Columns
- Chaining Operations
- Boolean Indexing
- Collecting Results
- Error Handling
- Limitations and Differences from Pandas
- Best Practices
- Performance Considerations
- Examples
- Data Reshaping
- Sampling and Limiting
- Concatenation
- Advanced Filtering
- SQL Expressions and CTEs
- Next Steps
- Using the Polars-Style Interface in Moltres
- Overview
- Getting Started
- Filtering
- Selecting Columns
- Adding and Modifying Columns
- GroupBy Operations
- Joins
- Sorting
- Data Manipulation
- Limiting and Sampling
- Data Inspection
- Collecting Results
- Chaining Operations
- Comparison with Polars LazyFrame
- Key Differences
- Reading Files (Polars-Style)
- Writing Files (Polars-Style)
- String Operations (
.strnamespace) - DateTime Operations (
.dtnamespace) - Window Functions
- Conditional Expressions (
when().then().otherwise()) - Additional Operations
- Set Operations
- SQL Expression Selection
- Common Table Expressions (CTEs)
- Additional Utility Methods
- Best Practices
- See Also
- SQL Approaches Comparison Guide
- Transaction Control Guide
- Transaction Utilities Guide
Framework & tooling integrations
Concepts, operations, and internals
Comparisons (reference)
Historical comparison reports. For current migration guidance, prefer Migrating from PySpark to Moltres and PySpark to Moltres Migration: Working Around Inconsistencies.
API reference
API reference