Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.6 instead.

frameworthy

PyPI Version PyPI pyversions codecov

Frameworthy is a lightweight Python testing library for dataframes and analytical transformations, supporting both Pandas and Polars. Instead of requiring exact expected outputs, it lets you express the properties a transformation should preserve or change: rows, keys, columns, values, aggregates, and more.

Many dataframe tests never get written because verifying a transformation means carefully constructing a second expected dataset. The goal of frameworthy is to make it easy to test what you actually care about, and extremely easy to understand why a test fails.

Getting Started

Installation

Available on PyPI.

pip install frameworthy
# or
uv add frameworthy
# or
poetry add frameworthy

Example

import frameworthy as fw
import pandas as pd

def transformation(df):
    return df.assign(col=df.col + 1)

input_df = pd.DataFrame({"col": [1, 2, 3]})
output_df = transformation(input_df)

# test that the transformation preserves row count
fw.expect(output_df, before=input_df).preserves_rows()

# test that the transformation preserves a key column
fw.expect(output_df, before=input_df).preserves_key("col")

Features

  • Compatible: Works with both Pandas and Polars dataframes through Narwhals. Support for more dataframe libraries is being explored for future releases.
  • User Friendly: Clear error messages that explain what failed and why.
  • Flexible: Intended to be equally useful with testing frameworks like pytest or in scripts for real-world validation.

Comparison with Similar Tools

What it checks Best for
Pandera / Great Expectations Does this dataframe conform to a schema? Validating pipeline inputs/outputs in critical production settings
Pandas/Polars assert_frame_equal Does this dataframe exactly equal that one? Regression tests once you already have a golden output reference
Frameworthy Did this transformation preserve invariants or change what it should? Testing transformation logic without building a full expected fixture

Frameworthy is built around asserting relational invariants between a transformation's input and output. Schema validators check one dataframe against a fixed spec; equality checks compare two dataframes exactly. In either case, you're expected to provide the expected schema output. Given the nature of real-world data transformation code, this means tests go unwritten. Moreover, in some cases schema definitions can be brittle and change frequently. This library aims to meet you where you are and help you write tests that are easy to understand and maintain.

We do recommend using Pandera for critical schema validation, it is very powerful. It can also validate a function's input and output via check_io, but each is still checked independently against its own schema.

Metadata

Release files for frameworthy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for frameworthy 0.1.1
File Size Uploaded
frameworthy-0.1.1.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for frameworthy 0.1.1
File Interpreter ABI Platform
frameworthy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / frameworthy-0.1.1.tar.gz

Download URL frameworthy-0.1.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
274c07c94d6b7162bd61cfabdff2ee3bc733cd60d8f37efc14e3823bc064231d
BLAKE2b-256 checksum
How to use checksums
8e10c258bf2dd86d781512e5f816ac486636e94e1bd8670a2d585816f5ab8204
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / frameworthy-0.1.1-py3-none-any.whl

Download URL frameworthy-0.1.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d994e88889c78e8a8958c42126617d8a97c889557fa6cc5d314be0e84da51fb
BLAKE2b-256 checksum
How to use checksums
0540b34e58d363e6833ad5d795a1f2f21d461f4a522b1aa86fc6fa5bad543ead
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page