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.10.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.10-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: databaseautomationhuz-0.0.10.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.10.tar.gz
Algorithm Hash digest
SHA256 31ef282397c1fa673a300ad3763f839ba3b3e5bac77223cb02ebf78c7cb23611
MD5 dadadc09ab2b6dc49dbb57838544e22a
BLAKE2b-256 b6b96930e2a649e071a10e33d0fc094c27b763059e8ee423a3e544d72718d1fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for databaseautomationhuz-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 ec7804a63ea1b955d068e14eceead6bd19788742fce0f6cc8aba4ad1b3a6de7e
MD5 f4f6485e879b81e6f1aebd4588ae0362
BLAKE2b-256 fc8d5886ed1acac357c722ec727f0ebc0212f69287527e1325198c6d930b4449

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