Skip to main content

CRUD operations for MongoDB

Project description

# requirements_dev.txt we use for the testing It makes it easier to install and manage dependencies for development and testing, separate from the dependencies required for production.

# difference between requirements_dev.txt and requirements.txt

requirements.txt is used to specify the dependencies required to run the production code of a Python project, while requirements_dev.txt is used to specify the dependencies required for development and testing purposes.

# tox.ini We use if for the testing in the python package testing against different version of the python

## how tox works tox enviornment creation 1. Install depedencies and packages 2. Run commands 3. Its a combination of the (virtualenvwrapper and makefile) 4. It creates a .tox

# pyproject.toml it is being used for configuration the python project it is a alternative of the setup.cfg file. its containts configuration related to the build system such as the build tool used package name version author license and dependencies

# setup.cfg In summary, setup.cfg is used by setuptools to configure the packaging and installation of a Python projec

# Testing python application types of testing 1. Automated testing 2. Manual testing

Mode of testing 1. Unit testing 2. Integration tests

Testing frameworks

  1. pytest

  2. unittest

  3. robotframework

  4. selenium

  5. behave

  6. doctest

# check with the code style formatting and syntax(coding standard)

  1. pylint

  2. flake8(it is best because it containt 3 library pylint pycodestyle mccabe)

  3. pycodestyle

# How to use the package :-

### STEPS:-

`bash pip install mongodb-crud-automation `

`bash from mongo_connect import mongo_crud `

`bash client_url = "<client_url_of_mongodb>" database_name = "<database name>" collection_name = "<collection_name>" `

`bash mongo = mongo_crud.mongodb_operation(client_url) `

# CRUD Operation on MongoDB :-

## How to run :-

### 1. connected to the mongodb client database

`bash mongo.create_client() `

### 2. create database in mongodb database

`bash mongo.create_database(database_name = "<database_name>") `

### 3. create collection_name in mongodb database

`bash mongo.create_collection(database_name= "<database_name>", collection_name="<collection_name>") `

### 4. insert single record

`bash mongo.insert_single_record(record:dict,database_name= "<database_name>", collection_name="<collection_name>") `

### 5. insert multiple records

`bash mongo.insert_multiple_records([record:dict],database_name= "<database_name>" , collection_name="<collection_name>") `

### 6. bulk insert record - in this datafile is in .csv or .xlsx file

`bash mongo.bulk_insert(datafile = "<file_path>",database_name= "<database_name>" , collection_name="<collection_name>",unique_field="<column_name>") `

### 4. find query `bash mongo.find(query: dict ={}, database_name= "<database_name>" ,collection_name="<collection_name>") `

### 5. update query `bash mongo.update(query: dict = {} , new_values: dict = {},database_name= "<database_name>" ,collection_name="<collection_name>") `

### 9. delete query `bash mongo.delete(query: dict = {} ,database_name= "<database_name>" , collection_name="<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

mongodb_crud_automation-0.0.11.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

mongodb_crud_automation-0.0.11-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file mongodb_crud_automation-0.0.11.tar.gz.

File metadata

File hashes

Hashes for mongodb_crud_automation-0.0.11.tar.gz
Algorithm Hash digest
SHA256 f213103d36520e8a1404950878808b5e2b12b3064411ee5e59f4377811fcbef4
MD5 3ea6ff4c24bb051a498f9da7964715a4
BLAKE2b-256 48314d9ad15fbfee8a871c01e8d70ba5029603aa99f5d50b2823d230e536401b

See more details on using hashes here.

File details

Details for the file mongodb_crud_automation-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for mongodb_crud_automation-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ddb572578f3108700eb149392167b94455967ddefb69d8cdc7f1cdf786ac8457
MD5 c6a52d7be52ffa6fb7eecadcfe840f62
BLAKE2b-256 0aa74b34c44a083b2dca2d4540720b2f81cfad5a73aca33438228f342285c366

See more details on using hashes here.

Supported by

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