Skip to main content

AI-powered DataFrame processing made simple

Project description

Airow

AI-powered DataFrame processing made simple

Airow is a Python library that combines pandas or Polars DataFrames with AI models to process structured data at scale. Built on top of pydantic-ai, it provides type-safe, async processing of DataFrames using any AI model.

Features

  • 🚀 Async processing with batch support for high performance
  • 🔒 Type-safe outputs using Pydantic models
  • 📊 Progress tracking with built-in progress bars
  • 🔄 Automatic retries with configurable retry logic
  • 🤖 Flexible AI models - works with OpenAI, Ollama, Anthropic, and more
  • Parallel processing within batches for maximum throughput
  • 📝 Structured outputs with defined schemas and validation

Installation

# Core library without a DataFrame backend
pip install airow

# pandas only
pip install "airow[pandas]"

# Polars only
pip install "airow[polars]"

# pandas and Polars
pip install "airow[all]"

Pandas example

Install Airow with the pandas backend:

pip install "airow[pandas]"

The examples use Pydantic AI's openai:gpt-5 model string, so configure the corresponding provider credentials before running them.

import asyncio

import pandas as pd

from airow import Airow, OutputColumn


async def main():
    df = pd.DataFrame(
        {
            "description": [
                "Bright citrus flavors with a crisp finish.",
                "Rich dark fruit with firm tannins.",
            ]
        }
    )

    airow = Airow(
        model="openai:gpt-5",
        system_prompt="You are an expert in wine tasting and selection.",
        batch_size=2,
    )

    output_columns = [
        OutputColumn(
            name="summary",
            type=str,
            description="A concise summary of the wine",
        ),
        OutputColumn(
            name="style",
            type=str,
            description="The inferred wine style",
        ),
    ]

    result_df = await airow.run(
        df,
        prompt="Analyze this wine description.",
        input_columns=["description"],
        output_columns=output_columns,
        show_progress=True,
    )

    # result_df is a pandas.DataFrame; df is unchanged.
    print(result_df.head())


if __name__ == "__main__":
    asyncio.run(main())

Airow detects pandas automatically and returns a new pandas.DataFrame.

Polars example

Install Airow with the Polars backend:

pip install "airow[polars]"
import asyncio

import polars as pl

from airow import Airow, OutputColumn


async def main():
    df = pl.DataFrame(
        {
            "description": [
                "Bright citrus flavors with a crisp finish.",
                "Rich dark fruit with firm tannins.",
            ]
        }
    )

    airow = Airow(
        model="openai:gpt-5",
        system_prompt="You are an expert in wine tasting and selection.",
        batch_size=2,
    )

    output_columns = [
        OutputColumn(
            name="summary",
            type=str,
            description="A concise summary of the wine",
        ),
        OutputColumn(
            name="style",
            type=str,
            description="The inferred wine style",
        ),
    ]

    result_df = await airow.run(
        df,
        prompt="Analyze this wine description.",
        input_columns=["description"],
        output_columns=output_columns,
        show_progress=True,
    )

    # result_df is a polars.DataFrame; df is unchanged.
    print(result_df.head())


if __name__ == "__main__":
    asyncio.run(main())

Airow detects eager Polars DataFrames automatically and returns a new polars.DataFrame. LazyFrames are not currently supported.

Custom backends

Custom dataframe implementations can subclass DataFrameBackend and pass an instance explicitly:

from airow import Airow, DataFrameBackend

backend: DataFrameBackend = MyDataFrameBackend()
airow = Airow(
    model="openai:gpt-5",
    system_prompt="You are a data processing assistant.",
    backend=backend,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airow-0.2.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airow-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file airow-0.2.0.tar.gz.

File metadata

  • Download URL: airow-0.2.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for airow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6d1350a752c86b358f82856edd76e8b2e90394b46881926a3592cb924a8255da
MD5 7b0eab5ec8c9a898483359df58d2583b
BLAKE2b-256 c56319ee595f262bfcf140083e9fa39f4237d475943ebaadb3f40b163b693333

See more details on using hashes here.

Provenance

The following attestation bundles were made for airow-0.2.0.tar.gz:

Publisher: publish.yml on dmitriiweb/airow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file airow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: airow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for airow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b060f5ac17230557893a444ec7327f067e343bcce2d0a721f0e935252ea93b0c
MD5 15bfbbb90af920fa591a8c447a812279
BLAKE2b-256 5a3ab8542cbfcd5e260fd90973ffebe2508df99a411da68504d71e794625d081

See more details on using hashes here.

Provenance

The following attestation bundles were made for airow-0.2.0-py3-none-any.whl:

Publisher: publish.yml on dmitriiweb/airow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page