Metadata-Version: 2.4
Name: zhibet_starter_pack
Version: 0.1.0
Summary: A database utility package using psycopg2
Author-email: Amadou Bah <Amadou.Bah@its.ny.gov>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: python-dotenv>=1.0.0
Dynamic: license-file

# zhibet

`zhibet` is a lightweight Python utility package designed to simplify PostgreSQL database connections and safe query execution using `psycopg2` and `python-dotenv`.

## Features

- **Easy Connection Management**: Automatically loads database credentials from environment variables.
- **SQL Injection Prevention**: Built-in support for safe, dynamic SQL query construction using `psycopg2.sql`.
- **Input Validation**: Helper utilities utilizing regular expressions to validate database inputs (like table names or email formats) before execution.

---

## Installation

You can install `zhibet` directly from PyPI:

```bash
pip install zhibet

``` Usage
users_table_schema = {
    # Replace "AUTOINCREMENT" with "GENERATED BY DEFAULT AS IDENTITY" for Postgres
    "id": ["INTEGER", "PRIMARY KEY", "GENERATED BY DEFAULT AS IDENTITY"],
    "username": ["TEXT", "NOT NULL", "UNIQUE"],
    "email": ["TEXT", "NOT NULL"],
    "age": ["INTEGER"],
    # Note: TIMESTAMP is preferred over TEXT for date/time fields in Postgres
    "created_at": ["TIMESTAMP", "DEFAULT CURRENT_TIMESTAMP"]
}

## Table Sample Data

created_table_name = "practice_creaction_table_1".lower()

sample_data = {
    "username": "Snow White",
    "email": "john.doe@example.com",
    "age": 45
}

sample_data_2 = {
    "username": "john_snow",
    "email": "john.sbow@example.com",
    "age": 21
}
