Metadata-Version: 2.4
Name: dbops-manager
Version: 0.1.7
Summary: A Python package for managing database operations with a focus on logging and simple CRUD operations.
Author-email: Ahmad Mujtaba <ahmad.mujtaba@codingcops.com>
License: MIT License
        
        Copyright (c) 2024 Ahmad Mujtaba (amz)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE. 
Project-URL: Homepage, https://github.com/codingcops/dbops-manager
Project-URL: Documentation, https://github.com/codingcops/dbops-manager#readme
Project-URL: Repository, https://github.com/codingcops/dbops-manager.git
Project-URL: Bug Tracker, https://github.com/codingcops/dbops-manager/issues
Keywords: database,postgresql,psycopg2,lambda
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: psycopg2-binary>=2.9.9
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: tqdm>=4.65.0
Dynamic: license-file

# DBops Manager

A Python package for managing database operations with a focus on logging and CRUD operations.

## Installation

You can install the package using pip:

```bash
pip install dbops-manager==0.1.6
```

## Features

- **Connection Management**: Easily manage database connections with support for environment variables.
- **CRUD Operations**: Perform Create, Read, Update, and Delete operations on your database.
- **Logging**: Log operations to the database for better tracking and debugging.

## Usage

### Basic Usage

```python
from dbops_manager.postgres_ops import PostgresOps

# Initialize the PostgreSQL operations
db_ops = PostgresOps()

# Create a table
db_ops.create_table('test_table', 'id SERIAL PRIMARY KEY, name VARCHAR(100), age INTEGER')

# Insert a row
db_ops.insert('test_table', {'name': 'Alice', 'age': 30})

# Fetch rows
rows = db_ops.fetch('test_table')
print(rows)

# Update a row
db_ops.update('test_table', {'name': 'Bob'}, 'id = 1')

# Delete a row
db_ops.delete('test_table', 'id = 1')
```

### Logging

The package logs operations to the `dbops_manager_logs` table. Ensure that the `logging_enabled` parameter is set to `True` when initializing `PostgresOps`.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 
