Metadata-Version: 2.1
Name: databaseautomationhuz
Version: 0.0.10
Summary: A python package for connecting with database.
Home-page: https://github.com/HuzaifaZaidi/neuron_mlops_mongodb
Author: HuzaifaZaidi
Author-email: huzaifaahmedzaidi@gmail.com
License: MIT
Project-URL: Bug Tracker, https://github.com/HuzaifaZaidi/neuron_mlops_mongodb/issues
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pymongo
Requires-Dist: pymongo[srv]
Requires-Dist: dnspython
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: ensure
Requires-Dist: pytest
Provides-Extra: testing
Requires-Dist: pytest>=7.1.3; extra == "testing"
Requires-Dist: mypy>=0.971; extra == "testing"
Requires-Dist: flake8>=5.0.4; extra == "testing"
Requires-Dist: tox>=3.25.1; extra == "testing"
Requires-Dist: black>=22.8.0; extra == "testing"

# databseautomationhuz

This is a lightweight Python package that simplifies working with MongoDB. It provides an easy-to-use interface for creating clients, connecting to databases, managing collections, inserting single or multiple records, and performing bulk inserts directly from CSV or Excel files. With built-in type safety checks and automatic handling of database/collection creation, it reduces boilerplate code and prevents common errors when interacting with MongoDB. Ideal for data engineering, ETL pipelines, and machine learning projects that require structured data storage and quick dataset imports into MongoDB.

## Example Usage

```python
# Import the class
from databseautomationhuz.mongo_crud import MongoOperation

# Step 1: Initialize MongoDB connection
db = MongoOperation("client_url", "db_name", "collection_name")

# Step 2: Insert a single record
db.insert_record({"name": "Huzaifa", "age": 25}, "Users")

# Step 3: Insert multiple records
db.insert_record(
    [
        {"name": "Sara", "age": 30},
        {"name": "John", "age": 40}
    ],
    "Users"
)

# Step 4: Bulk insert from CSV
db.bulk_insert("employees.csv", "Employees")

# Step 5: Bulk insert from Excel
db.bulk_insert("sales_data.xlsx", "Sales")
