Metadata-Version: 2.1
Name: mongo_test_ts
Version: 0.0.9
Summary: A python package for connecting with database.
Home-page: https://github.com/HakimOwais/dynamic-test
Author: HakimOwais
Author-email: owaisibnmushtaq@gmail.com
License: MIT
Project-URL: Bug Tracker, https://github.com/HakimOwais/dynamic-test/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
Requires-Dist: ensure==1.0.2
Requires-Dist: py-youtube==1.1.7
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"

# MongoDB Connection Utility
## Overview

This Python package provides utility functions to simplify interactions with MongoDB databases. It allows you to easily create a MongoDB client, database, and collection, as well as insert records into the database.
Installation

#### You can install the package using pip:

bash

* pip install mongo_connection_owais

## Usage

#### To use this package, follow these steps:

   Import the mongo_operation class from the package:

* from mongo_connection_owais import mongo_operation

Create an instance of the mongo_operation class by providing the MongoDB connection URL, database name, and optional collection name:


* client_url = "mongodb://localhost:27017/"
* database_name = "my_database"
* collection_name = "my_collection"
* mongo_op = mongo_operation(client_url, database_name, collection_name)

#### Insert records into the MongoDB collection:

* record = {"key": "value"}
* mongo_op.insert_record(record, collection_name)

#### Perform bulk insertion of data from a CSV or Excel file:


* datafile = "data.csv"
* mongo_op.bulk_insert(datafile, collection_name)
