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.2

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.2
File Size Uploaded
frameworthy-0.1.2.tar.gz 4.5 kB Details

Built distribution (wheel)

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

Total release size: 10.6 kB

Release files / frameworthy-0.1.2.tar.gz

Download URL frameworthy-0.1.2.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b8f0081feec01d832725d1a72cfc56cea80fd046a2a7a5ec8bf6e91f956bbf68
BLAKE2b-256 checksum
How to use checksums
4f8f1cda2f4fd2e4cbcf576b0ea000b27ebec420d7604c5fc507c6a3125478fa
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.2-py3-none-any.whl

Download URL frameworthy-0.1.2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ada8a0261fa336083d1da8df3c047219c7a52873a0e99f41946460e2172eb159
BLAKE2b-256 checksum
How to use checksums
413d29500588fe73594be534eee973c192ed87eaa6a63bd380f51fe93cf8b9ef
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.2 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