A package for simplified database operations with PostgreSQL and Pandas.
Project description
DataQuery 
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:
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
Install DataQuery using pip:
pip install dataquery
Or, if you're installing directly from the source:
git clone https://github.com/yourusername/querycraft.git
cd dataquery
pip install .
Usage
Initialization
First, initialize the DataQuery object with your database credentials:
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:
df = qc.retrieve_data('table_name', {'column_name': 'value'})
Updating Data
To update data in a table:
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:
- Create a New Branch: Create a new branch for your feature or fix.
- Commit Your Changes: Make your changes and commit them to your branch.
- Push to Your Brach: Push your branch on GitHub.
- 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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataquery-0.1.1.tar.gz.
File metadata
- Download URL: dataquery-0.1.1.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ec97bce3c4ba56b09c37f18253aef2aeebeec2948d2a2b7b98a7d1dc796e3a7
|
|
| MD5 |
996210b1464fdaa74fce42d01118734d
|
|
| BLAKE2b-256 |
13d9bf5944ad20383b9cc0c95aae66f21bfbc4f465b735c35ef3b8d967aee8c7
|
File details
Details for the file dataquery-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dataquery-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f4d2ce4986b8aa4e57ef8933c8e7c39675092201bc118229b937d6409c12be4
|
|
| MD5 |
f12b4c4693429303e1d842e1cea7340a
|
|
| BLAKE2b-256 |
d849fd776f12b7f08a8aec8e66aee793f7d2fdcccf5229a2a90b38b15013c152
|