Skip to main content

A python package for connecting with database.

Project description

# 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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mongo_test_ts-0.1.8.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mongo_test_ts-0.1.8-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file mongo_test_ts-0.1.8.tar.gz.

File metadata

  • Download URL: mongo_test_ts-0.1.8.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mongo_test_ts-0.1.8.tar.gz
Algorithm Hash digest
SHA256 0e99549e93d9c4aa5a727c2394f64d6fa4d35cf9911cb6dde96b591b6c0bef29
MD5 6217de96c5b2e899d8be4856e182d86c
BLAKE2b-256 b7ed10d0fc2d99db06480e001e1481ebf2783cce70a728090d75424524b28a26

See more details on using hashes here.

File details

Details for the file mongo_test_ts-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: mongo_test_ts-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mongo_test_ts-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9f60d1ab65dd8f56d1d79895a7a215c53eec3f69c4163e06d9c5a266f59477f0
MD5 2ed9c7bc0caa48ca5b6f0495bfbd159a
BLAKE2b-256 a637fa6d88b658e44ee9ece661dd4b7f4d3528f1f3ecfb8bd2cfd6ca7ca76aa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page