Skip to main content

No project description provided

Project description

Data Quality Summary using LLM

This Python package generates a data quality report for a dataset using a Large Language Model (LLM) such as OpenAI's GPT. It takes a Pandas DataFrame as input and returns a human-readable report about potential data issues. The package also includes full LLM responses and logs for transparency.

Features

  • Accepts any Pandas DataFrame as input.
  • Connects to an LLM using OpenAI API credentials.
  • Generates intelligent data quality reports.
  • Optionally allows custom prompts to guide the LLM.
  • Includes raw model responses and logs for traceability.

Class: DataQualitySummery

__init__(api_key: str, base_url: str, model: str, temprature: float, max_token: int)

Initializes the LLM connection.

Parameters:

  • api_key: OpenAI or compatible API key.
  • base_url: Base URL of the LLM API.
  • model: The model name, e.g., "gpt-4".
  • temprature: Float to control randomness.
  • max_token: Maximum tokens allowed in the LLM response.

data_quality_details(data: pd.DataFrame, response: str = None) -> str

Generates a data quality report using the provided DataFrame.

Parameters:

  • data: A pandas DataFrame.
  • response: Optional custom instruction for the LLM.

Returns:

  • A string containing the data quality report, including raw LLM responses.

Example Usage

from your_module import DataQualitySummery
import pandas as pd

# Create a sample DataFrame
df = pd.DataFrame({
    'Name': ['Alice', None, 'Charlie'],
    'Age': [25, 30, None]
})

# Initialize the class
dq = DataQualitySummery(
    api_key='your-api-key',
    base_url='https://api.openai.com/v1',
    model='gpt-4',
    temprature=0.7,
    max_token=500
)

# Generate the report
report = dq.data_quality_details(df)
print(report)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dq_summary_llm-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dq_summary_llm-0.0.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file dq_summary_llm-0.0.2.tar.gz.

File metadata

  • Download URL: dq_summary_llm-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for dq_summary_llm-0.0.2.tar.gz
Algorithm Hash digest
SHA256 bce34959a211458d2d4e70f940d4595e88e2b0a04ae3658b19948e3f1eec85f0
MD5 6dd43997b436ea026f8b25adcfffa89d
BLAKE2b-256 47aca60bba09dae367e342371ef5df71b49b81358d7034406b2e72041c605c7a

See more details on using hashes here.

File details

Details for the file dq_summary_llm-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dq_summary_llm-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for dq_summary_llm-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c5298fa058ee52885f8a01bf509ac7c7046a6f37c748b0bc1929c8159fb62a4
MD5 b55a6e3061edc2bbd547a4a6d20a63a3
BLAKE2b-256 7306e4e9d917a231beb3c08566d06b3268d69f73bb810f2777bfec6c22f4392a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page