Create data quality rules and apply them to datasets.
Project description
DQAI (Data Quality Artificial Intelligence)
This code provides a Python class called DQAI
that utilizes the OpenAI Chat API to analyze a dataset and generate data quality rules specific to the data.
Usage
- Install the necessary dependencies.
- Set up your OpenAI API key or use the provided default key.
- Prepare your dataset in a suitable format (e.g., CSV).
- Instantiate the
DQAI
class. - Invoke the
invoke_from_dataset
method, passing the dataset as input. - The code will generate Python code based on the dataset and execute it.
- The generated rules and the results will be saved in the current directory as "generated_code.py" and "rulesapplication.csv," respectively.
- The generated rules can be obtained by calling the
_get_rules_from_file
method.
Example:
import pandas as pd
from dqai import DQAI
Read the dataset from a CSV file
path = "path/to/your/dataset.csv"
data = pd.read_csv(path)
Instantiate DQAI and generate data quality rules
key = OPEN_AI_KEY
dqai = DQAI(key)
result = dqai.invoke_from_dataset(data)
Access the generated rules and results
rules = result["0"]
results_df = result["1"]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dq_ai_module-1.1.0.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file dq_ai_module-1.1.0.tar.gz
.
File metadata
- Download URL: dq_ai_module-1.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b834ce9ca211adae6370e9150888d282a559165f5bad13f4e9e6c12f591b97a |
|
MD5 | daf873651ab7a095df03a8c63b00821c |
|
BLAKE2b-256 | 8602b1762f2adc1c83f2f429511e85f7ce96b748cdd584c801997bc7cd90eaf6 |
File details
Details for the file dq_ai_module-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: dq_ai_module-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82356958e33afef93cbd8eaf2d6d79eb81820d94113f409325997cfcc4b4ff6c |
|
MD5 | d35a9b01fcf7b9ac8a218363230aa085 |
|
BLAKE2b-256 | 92a976f32f45d99caffdaf1b6d942461224588f67f0f3ecc838af78286dc97d0 |