Skip to content

Repository files navigation

Portabellas

PyPI Main codecov Documentation Status

Type-safe, ergonomic table operations, with the speed of Polars.

Installation

pip install portabellas

Why Portabellas?

Portabellas is built on Polars, so you get the same query optimization and parallelization, with these improvements on top:

  • Early validation: Catch type and name errors directly where they occur, with negligible runtime overhead.

    # Portabellas
    from portabellas import Table
    
    data = Table({"name": ["Alice", "Bob"], "age": [25, 30]})
    data = data.add_computed_column("result", lambda row: row["age"].struct.get("name"))
    #                                                     ^^^^^^^^^^^^^^^^^
    #
    # ColumnTypeError: Expected struct type, got i64
    # Polars — same mistake, but error is deferred and misleading
    import polars as pl
    
    data = pl.LazyFrame({"name": ["Alice", "Bob"], "age": [25, 30]})
    data = data.with_columns(result=pl.col("age").struct.field("name"))  # No error
    data = data.collect()
    #      ^^^^^^^^^^^^^^
    #
    # StructFieldNotFoundError: name
  • No lazy/eager split: No need to manually switch between lazy and eager mode. Lazy evaluation is active whenever possible. Operations that require eager mode handle it automatically.

  • Familiar abstractions: Work with Table, Column, Row, and Cell — names that match how you think about data, not how the library stores it.

Fun fact: "Portabellas" is an anagram of "Polars table". And, as for any proper Python package, it starts with P.

For Developers

Project Setup

  1. Install uv.
  2. Run uv sync to generate a venv and install the dependencies.
  3. Activate your venv by running source .venv/bin/activate.

(Optional) Pre-Commit Hooks

We use pre-commit hooks for linting and formatting. Install the commit hooks locally via:

pre-commit install

The configuration can be adapted in .pre-commit-config.yaml.

About

Type-safe, ergonomic table operations, with the speed of Polars.

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages