Skip to main content

A python package for connecting with database.

Project description

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

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

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

databaseautomationhuz-0.0.8.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

databaseautomationhuz-0.0.8-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file databaseautomationhuz-0.0.8.tar.gz.

File metadata

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

File hashes

Hashes for databaseautomationhuz-0.0.8.tar.gz
Algorithm Hash digest
SHA256 494feafdf436318a77a488c51a7759bc7833883c0bcb6458603b0c952e4a7642
MD5 9c321f716f88cdff130ace628aa4370c
BLAKE2b-256 b5191db14b07163d517e45128d149a6051c68eea9aa5f32db5b784f56748c5c2

See more details on using hashes here.

File details

Details for the file databaseautomationhuz-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for databaseautomationhuz-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4bd7751853c90183a73f0e1867d148b98a171d44ea486eb2a6fa1260e72dbc83
MD5 f571b5470b63c7f708a84dd2afd7b307
BLAKE2b-256 edabbee4400cf26237e22c9bbfaa3dbcb98664ed04a59b95d26e3646623a55d2

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