Metadata-Version: 2.2
Name: pointblank
Version: 0.4.0
Summary: Find out if your data is what you think it is.
Author-email: Richard Iannone <riannone@me.com>
License: MIT License
        
        Copyright (c) 2025 Richard Iannone
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/rich-iannone/pointblank
Keywords: data,quality,validation,testing,data science,data engineering
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: commonmark>=0.9.1
Requires-Dist: importlib-metadata
Requires-Dist: great_tables>=0.13.0
Requires-Dist: narwhals>=1.18.4
Requires-Dist: typing_extensions>=3.10.0.0
Provides-Extra: pd
Requires-Dist: pandas>=2.2.3; extra == "pd"
Provides-Extra: pl
Requires-Dist: polars>=1.17.1; extra == "pl"
Provides-Extra: duckdb
Requires-Dist: ibis-framework[duckdb]>=9.5.0; extra == "duckdb"
Provides-Extra: mysql
Requires-Dist: ibis-framework[mysql]>=9.5.0; extra == "mysql"
Provides-Extra: postgres
Requires-Dist: ibis-framework[postgres]>=9.5.0; extra == "postgres"
Provides-Extra: sqlite
Requires-Dist: ibis-framework[sqlite]>=9.5.0; extra == "sqlite"
Provides-Extra: docs
Requires-Dist: jupyter; extra == "docs"
Requires-Dist: nbclient>=0.10.0; extra == "docs"
Requires-Dist: nbformat>=5.10.4; extra == "docs"
Requires-Dist: quartodoc>=0.8.1; python_version >= "3.9" and extra == "docs"
Requires-Dist: pandas>=2.2.3; extra == "docs"
Requires-Dist: polars>=1.17.1; extra == "docs"

<div align="center">

<img src="images/pointblank_logo.svg" alt="Pointblank logo" width="350px"/>

_Find out if your data is what you think it is._

[![Python Versions](https://img.shields.io/pypi/pyversions/pointblank.svg)](https://pypi.python.org/pypi/pointblank)
[![PyPI](https://img.shields.io/pypi/v/pointblank)](https://pypi.org/project/pointblank/#history)
[![PyPI Downloads](https://img.shields.io/pypi/dm/pointblank)](https://pypistats.org/packages/pointblank)
[![License](https://img.shields.io/github/license/rich-iannone/pointblank)](https://img.shields.io/github/license/rich-iannone/pointblank)

[![CI Build](https://github.com/rich-iannone/pointblank/actions/workflows/ci-tests.yaml/badge.svg)](https://github.com/rich-iannone/pointblank/actions/workflows/ci-tests.yaml)
[![Codecov branch](https://img.shields.io/codecov/c/github/rich-iannone/pointblank/main.svg)](https://codecov.io/gh/rich-iannone/pointblank)
[![Repo Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Documentation](https://img.shields.io/badge/docs-project_website-blue.svg)](https://rich-iannone.github.io/pointblank/)

[![Contributors](https://img.shields.io/github/contributors/rich-iannone/pointblank)](https://github.com/rich-iannone/pointblank/graphs/contributors)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html)

</div>

Pointblank is a table validation and testing library for Python. It helps you ensure that your tabular data meets certain expectations and constraints and it presents the results in a beautiful (and useful!) validation table.

## Getting Started

Let's take a Polars DataFrame and validate it against a set of constraints. We do that by using the `pb.Validate` class and then adding validation steps:

```python
import pointblank as pb

validation = (
    pb.Validate(data=pb.load_dataset(dataset="small_table")) # Use Validate() to start
    .col_vals_gt(columns="d", value=100)       # STEP 1 |
    .col_vals_le(columns="c", value=5)         # STEP 2 | <-- Build up a validation plan
    .col_exists(columns=["date", "date_time"]) # STEP 3 |
    .interrogate() # This will execute all validation steps and collect intel
)

validation
```

<img src="images/pointblank-tabular-report.png" alt="Validation Report">

The rows in the validation table correspond to each of the validation steps. One of the key concepts is that validation steps can be broken down into atomic test cases (test units) and each of these test units is given either of pass/fail status based on the validation constraints. You'll see these tallied up in the reporting table (in the `UNITS`, `PASS`, and `FAIL` columns).

Tabular reporting is just one way to see the results. You can also obtain fine-grained results of the interrogation as JSON output or through methods that get key metrics. You can also utilize the validation results to perform filtering of the input table based on row-level pass/fail status (via the `get_sundered_data()` method).

On the input side, we can use the following types of tables:

- Polars DataFrame
- Pandas DataFrame
- DuckDB table
- MySQL table
- PostgreSQL table
- SQLite table
- Parquet

To make this all work seamlessly, we use [Narwhals](https://github.com/narwhals-dev/narwhals) to work with Polars and Pandas DataFrames. We also integrate with [Ibis](https://github.com/ibis-project/ibis) to enable the use of DuckDB, MySQL, PostgreSQL, SQLite, and Parquet. In doing all of this, we can provide an ergonomic and consistent API for validating tabular data from various sources.

## Features

Here's a short list of what we think makes pointblank a great tool for data validation:

- **Declarative Syntax**: Define your data validation rules simply, using a declarative syntax
- **Flexible**: We support tables from Polars, Pandas, Duckdb, MySQL, PostgreSQL, SQLite, and Parquet
- **Beautiful Reports**: Generate beautiful HTML table reports on how the data validation went down
- **Functional Output**: Extract the specific data validation outputs you need for further processing
- **Data Testing**: Write tests for your data and use them in your notebooks or testing framework
- **Easy to Use**: Get started quickly with a simple API and super clear documentation
- **Powerful**: You can develop complex data validation rules with flexible options for customization

## Installation

You can install pointblank using pip:

```bash
pip install pointblank
```

If you encounter a bug, have usage questions, or want to share ideas to make this package better, please feel free to file an [issue](https://github.com/rich-iannone/pointblank/issues).

## Code of Conduct

Please note that the pointblank project is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).<br>By participating in this project you agree to abide by its terms.

## Contributing to pointblank

There are many ways to contribute to the ongoing development of pointblank. Some contributions can be simple (like fixing typos, improving documentation, filing issues for feature requests or problems, etc.) and others might take more time and care (like answering questions and submitting PRs with code changes). Just know that anything you can do to help would be very much appreciated!

Please read over the [contributing guidelines](https://github.com/rich-iannone/pointblank/blob/main/CONTRIBUTING.md) for information on how to get started.

## 📄 License

Pointblank is licensed under the MIT license.

## 🏛️ Governance

This project is primarily maintained by [Rich Iannone](https://bsky.app/profile/richmeister.bsky.social).
Other authors may occasionally assist with some of these duties.
