Metadata-Version: 2.1
Name: dataquery
Version: 0.1.1
Summary: A package for simplified database operations with PostgreSQL and Pandas.
Author-email: Praveen <praveen.nitap@gmail.com>
Maintainer-email: Praveen <praveen.nitap@gmail.com>
License: BSD 3-Clause License
Project-URL: Homepage, https://github.com/praveen-uofg/dataquery
Project-URL: Documentation, https://github.com/praveen-uofg/dataquery
Project-URL: Repository, https://github.com/praveen-uofg/dataquery
Keywords: database,SQL,PostgreSQL,pandas
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.4.0
Requires-Dist: psycopg2-binary>=2.9.3
Requires-Dist: sqlalchemy>=1.4.31

# DataQuery [![Testing and Static Analysis](https://github.com/praveen-uofg/dataquery/actions/workflows/general-pipeline.yml/badge.svg)](https://github.com/praveen-uofg/dataquery/actions/workflows/general-pipeline.yml)

## About
DataQuery is a Python package designed to simplify interactions with PostgreSQL databases. It leverages SQLAlchemy and pandas to provide an intuitive interface for retrieving, updating, inserting, and deleting data within a database. This package is ideal for data scientists and developers looking for a streamlined way to handle database operations.

## Features
- Easy retrieval of data into pandas DataFrames.
- Simplified update, insert, and delete operations.
- Customizable query capabilities with filtering criteria.
- Designed with best practices in database connections and session management.

## Installation

Ensure you have Python 3.11 or higher installed. It's recommended to use a virtual environment:

```bash
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
```

Install DataQuery using pip:

```bash
pip install dataquery
```

Or, if you're installing directly from the source:

```bash
git clone https://github.com/yourusername/querycraft.git
cd dataquery
pip install .
```

## Usage

### Initialization

First, initialize the DataQuery object with your database credentials:

```python
from dataquery import DataQuery

qc = DataQuery(host='localhost', port='5432', username='your_username', password='your_password',
                database='your_database')
```

### Retrieving Data

To retrieve data from a table:

```bash
df = qc.retrieve_data('table_name', {'column_name': 'value'})
```

### Updating Data

To update data in a table:

```bash
from pandas import DataFrame

data = DataFrame({...})  # Your data to update
qc.update_data('table_name', ['column_to_match'], data)
```

Replace `'table_name'`, `['column_to_match']`, and `data` with your specific table name, columns to match, and DataFrame containing the new data.

## Contribution and Development Guidelines

Contributions to DataQuery are welcome! If you're interested in contributing, please follow these guidelines:


1. **Create a New Branch**: Create a new branch for your feature or fix.
2. **Commit Your Changes**: Make your changes and commit them to your branch.
3. **Push to Your Brach**: Push your branch on GitHub.
4. **Submit a Pull Request**: Submit a pull request from your branch to the development branch.

Please ensure your code adheres to PEP 8 standards and include tests for new features or bug fixes.

## License

DataQuery is licensed under the BSD 3-Clause License. See the LICENSE file for more details.
